mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Further alert implementation #17
This commit is contained in:
@@ -10,8 +10,9 @@ import pytz
|
||||
class CleanupTimer:
|
||||
|
||||
# Constructor
|
||||
def __init__(self, spots, cleanup_interval):
|
||||
def __init__(self, spots, alerts, cleanup_interval):
|
||||
self.spots = spots
|
||||
self.alerts = alerts
|
||||
self.cleanup_interval = cleanup_interval
|
||||
self.cleanup_timer = None
|
||||
self.last_cleanup_time = datetime.min.replace(tzinfo=pytz.UTC)
|
||||
@@ -30,6 +31,7 @@ class CleanupTimer:
|
||||
try:
|
||||
# Perform cleanup
|
||||
self.spots.expire()
|
||||
self.alerts.expire()
|
||||
self.status = "OK"
|
||||
self.last_cleanup_time = datetime.now(pytz.UTC)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user