Fix bug introduced in new linter (#6754)

* Fix bug introduced in new linter

* Ignore this error

* Fix more

* Ignore boolean error too
This commit is contained in:
Nicolas Mowen
2023-06-11 06:18:47 -06:00
committed by GitHub
parent d3949eebfa
commit 435d152423
6 changed files with 13 additions and 13 deletions

View File

@@ -52,7 +52,7 @@ class EventCleanup(threading.Thread):
Event.camera.not_in(self.camera_keys),
Event.start_time < expire_after,
Event.label == event.label,
Event.retain_indefinitely is False,
Event.retain_indefinitely == False,
)
# delete the media from disk
for event in expired_events:
@@ -72,7 +72,7 @@ class EventCleanup(threading.Thread):
Event.camera.not_in(self.camera_keys),
Event.start_time < expire_after,
Event.label == event.label,
Event.retain_indefinitely is False,
Event.retain_indefinitely == False,
)
update_query.execute()
@@ -101,7 +101,7 @@ class EventCleanup(threading.Thread):
Event.camera == name,
Event.start_time < expire_after,
Event.label == event.label,
Event.retain_indefinitely is False,
Event.retain_indefinitely == False,
)
# delete the grabbed clips from disk
for event in expired_events:
@@ -120,7 +120,7 @@ class EventCleanup(threading.Thread):
Event.camera == name,
Event.start_time < expire_after,
Event.label == event.label,
Event.retain_indefinitely is False,
Event.retain_indefinitely == False,
)
update_query.execute()
@@ -167,7 +167,7 @@ class EventCleanup(threading.Thread):
# drop events from db where has_clip and has_snapshot are false
delete_query = Event.delete().where(
Event.has_clip is False, Event.has_snapshot is False
Event.has_clip == False, Event.has_snapshot == False
)
delete_query.execute()

View File

@@ -61,7 +61,7 @@ class EventProcessor(threading.Thread):
def run(self) -> None:
# set an end_time on events without an end_time on startup
Event.update(end_time=Event.start_time + 30).where(
Event.end_time is None
Event.end_time == None
).execute()
while not self.stop_event.is_set():
@@ -95,7 +95,7 @@ class EventProcessor(threading.Thread):
# set an end_time on events without an end_time before exiting
Event.update(end_time=datetime.datetime.now().timestamp()).where(
Event.end_time is None
Event.end_time == None
).execute()
logger.info("Exiting event processor...")