fix: validate atomic configuration updates and expire stale monitoring snapshots
This commit is contained in:
@@ -174,7 +174,7 @@ class StorageCache:
|
||||
values = data['values']
|
||||
if all(isinstance(values[k], int) and not isinstance(values[k], bool) and values[k] >= 0 for k in ('total', 'used', 'free')) and values['total'] > 0 and values['used'] <= values['total']:
|
||||
at = data['observed_at']
|
||||
if isinstance(at, (int, float)) and 0 <= self.clock() - at < 90000:
|
||||
if isinstance(at, (int, float)) and 0 <= self.clock() - at < 604800:
|
||||
self.values, self.observed_at = values, at
|
||||
if not self.error:self.next_update_at = at + 604800
|
||||
except (OSError, ValueError, KeyError, TypeError):
|
||||
|
||||
Reference in New Issue
Block a user