From b456a15dfc38096a047c2ad0cd02456de1cc76bc Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 17 Oct 2022 02:26:35 +0200 Subject: [PATCH] Switch backup action to new schedule syntax (#3801) --- InvenTree/InvenTree/apps.py | 6 ------ InvenTree/InvenTree/tasks.py | 1 + 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/InvenTree/InvenTree/apps.py b/InvenTree/InvenTree/apps.py index 52384620c0a5..42b6b55be24d 100644 --- a/InvenTree/InvenTree/apps.py +++ b/InvenTree/InvenTree/apps.py @@ -65,12 +65,6 @@ def start_background_tasks(self): ) logger.info("Started background tasks...") - # Make regular backups - InvenTree.tasks.schedule_task( - 'InvenTree.tasks.run_backup', - schedule_type=Schedule.DAILY, - ) - def update_exchange_rates(self): # pragma: no cover """Update exchange rates each time the server is started. diff --git a/InvenTree/InvenTree/tasks.py b/InvenTree/InvenTree/tasks.py index 7c22a7bb31eb..571b441a5c75 100644 --- a/InvenTree/InvenTree/tasks.py +++ b/InvenTree/InvenTree/tasks.py @@ -342,6 +342,7 @@ def update_exchange_rates(): logger.error(f"Error updating exchange rates: {e}") +@scheduled_task(ScheduledTask.DAILY) def run_backup(): """Run the backup command.""" call_command("dbbackup", noinput=True, clean=True, compress=True, interactive=False)