Switch backup action to new schedule syntax (#3801)

This commit is contained in:
Matthias Mair 2022-10-17 02:26:35 +02:00 committed by GitHub
parent 0bea2c7b56
commit b456a15dfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View File

@ -65,12 +65,6 @@ class InvenTreeConfig(AppConfig):
)
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.

View File

@ -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)