diff --git a/unzipper/helpers/start.py b/unzipper/helpers/start.py index 508ce26d..f116bf82 100644 --- a/unzipper/helpers/start.py +++ b/unzipper/helpers/start.py @@ -124,9 +124,8 @@ def removal(firststart=False): async def remove_expired_tasks(firststart=False): - value = firststart ongoing_tasks = await get_ongoing_tasks() - if value: + if firststart: await clear_ongoing_tasks() try: shutil.rmtree(Config.DOWNLOAD_LOCATION) @@ -168,8 +167,6 @@ async def remove_expired_tasks(firststart=False): ), ) - value = firststart = False - @aiocron.crontab("*/5 * * * *") async def scheduled_remove_expired_tasks():