Made purge interval configurable and default back to once a day

This commit is contained in:
Sebastian Goscik
2022-12-30 13:14:31 +00:00
parent ca455ebcd0
commit 8ed60aa925
5 changed files with 38 additions and 11 deletions

View File

@@ -2,6 +2,7 @@ import logging
import re
import asyncio
from typing import Optional
from datetime import datetime
from dateutil.relativedelta import relativedelta
@@ -385,3 +386,9 @@ class VideoQueue(asyncio.Queue):
self._unfinished_tasks += 1
self._finished.clear()
self._wakeup_next(self._getters)
async def wait_until(dt):
# sleep until the specified datetime
now = datetime.now()
await asyncio.sleep((dt - now).total_seconds())