core(major): add integrated database backup
This commit is contained in:
13
passbook/lib/tasks.py
Normal file
13
passbook/lib/tasks.py
Normal file
@ -0,0 +1,13 @@
|
||||
"""passbook misc tasks"""
|
||||
from django.core import management
|
||||
from structlog import get_logger
|
||||
|
||||
from passbook.root.celery import CELERY_APP
|
||||
|
||||
LOGGER = get_logger()
|
||||
|
||||
@CELERY_APP.task()
|
||||
def backup_database():
|
||||
"""Backup database"""
|
||||
management.call_command('dbbackup')
|
||||
LOGGER.info('Successfully backed up database.')
|
||||
Reference in New Issue
Block a user