quieter-restoration-time #64

Merged
buckbanzai merged 3 commits from quieter-restoration-time into main 2024-10-27 12:30:45 -07:00
Showing only changes of commit fa8a14e539 - Show all commits

13
scl.py
View file

@ -326,7 +326,18 @@ with Session(engine) as session:
existing_record = lookup_result.one()
updated_properties = []
updated_entries = []
if estimated_restoration_time != existing_record.estimated_restoration_time:
est_restoration_diff_mins = (
abs(
(
estimated_restoration_time
- existing_record.estimated_restoration_time
).total_seconds()
)
/ 60
)
# Only post if estimated restoration time has changed by 30m or more
if est_restoration_diff_mins >= 30:
existing_record.estimated_restoration_time = estimated_restoration_time
if estimated_restoration_time > datetime.now():
# New estimated restoration time is in the future, so likely to be a real time