Skip to content

Commit

Permalink
Add measurement folder settings
Browse files Browse the repository at this point in the history
  • Loading branch information
meomancer committed Jun 12, 2024
1 parent 1a517ea commit bfbdb50
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions models/well.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,9 @@ def return_measurement_cache_path(self, measurement_name: str):
"""
Return file path of cache file
"""
folder = os.path.join(settings.MEDIA_ROOT, 'measurement-cache',
'{}'.format(self.id))
folder = os.path.join(
settings.MEASUREMENTS_FOLDER, '{}'.format(self.id)
)
return os.path.join(folder, '{}.gz'.format(measurement_name))

def measurement_data(self, measurement_name: str):
Expand Down Expand Up @@ -282,7 +283,7 @@ def measurement_data(self, measurement_name: str):
def generate_measurement_cache(self, model=None):
""" Generate measurement cache """
folder = os.path.join(
settings.MEDIA_ROOT, 'measurement-cache', '{}'.format(self.id)
settings.MEASUREMENTS_FOLDER, '{}'.format(self.id)
)
if not os.path.exists(folder):
os.makedirs(folder)
Expand Down

0 comments on commit bfbdb50

Please sign in to comment.