Skip to content

Commit

Permalink
Restore data property in config
Browse files Browse the repository at this point in the history
  • Loading branch information
oscgonfer committed Jun 11, 2024
1 parent 1a306f3 commit a69b66b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions scdata/_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ class Config(object):
### ---------------------------------------
### -----------------DATA------------------
### ---------------------------------------
# Data Margin in minutes for consecutive requests
_cache_data_margin = '10Min'
data = {
'cached_data_margin': '10Min', # Data Margin in minutes for consecutive requests
'reload_metadata': True # Reload metadata
}

# Maximum amount of points to load when postprocessing data
_max_load_amount = 500
Expand Down
2 changes: 1 addition & 1 deletion scdata/device/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ async def load(self, cache=None, convert_units=True, convert_names=True, max_amo
# Make request with a logical min_date
if not cached_data.empty:
# Update min_date
min_date=cached_data.index[-1].tz_convert('UTC')+Timedelta(frequency)+Timedelta(config._cache_data_margin)
min_date=cached_data.index[-1].tz_convert('UTC')+Timedelta(frequency)+Timedelta(config.data['cached_data_margin'])

# Not implemented "for now"
elif self.source.type == 'stream':
Expand Down

0 comments on commit a69b66b

Please sign in to comment.