Skip to content

Commit

Permalink
Switch backup action to new schedule syntax (#3801)
Browse files Browse the repository at this point in the history
  • Loading branch information
matmair authored Oct 17, 2022
1 parent 0bea2c7 commit b456a15
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 0 additions & 6 deletions InvenTree/InvenTree/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions InvenTree/InvenTree/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b456a15

Please sign in to comment.