mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 19:46:46 +00:00
Switch backup action to new schedule syntax (#3801)
This commit is contained in:
parent
0bea2c7b56
commit
b456a15dfc
@ -65,12 +65,6 @@ class InvenTreeConfig(AppConfig):
|
|||||||
)
|
)
|
||||||
logger.info("Started background tasks...")
|
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
|
def update_exchange_rates(self): # pragma: no cover
|
||||||
"""Update exchange rates each time the server is started.
|
"""Update exchange rates each time the server is started.
|
||||||
|
|
||||||
|
@ -342,6 +342,7 @@ def update_exchange_rates():
|
|||||||
logger.error(f"Error updating exchange rates: {e}")
|
logger.error(f"Error updating exchange rates: {e}")
|
||||||
|
|
||||||
|
|
||||||
|
@scheduled_task(ScheduledTask.DAILY)
|
||||||
def run_backup():
|
def run_backup():
|
||||||
"""Run the backup command."""
|
"""Run the backup command."""
|
||||||
call_command("dbbackup", noinput=True, clean=True, compress=True, interactive=False)
|
call_command("dbbackup", noinput=True, clean=True, compress=True, interactive=False)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user