parent
f9a72a4115
commit
2d39957070
@ -297,6 +297,8 @@ def screenshot(self):
|
|||||||
|
|
||||||
@worker_ready.connect
|
@worker_ready.connect
|
||||||
def at_start(sender, **k):
|
def at_start(sender, **k):
|
||||||
|
logger.info("Worker is ready")
|
||||||
|
# create screenshot
|
||||||
if not os.path.isfile(SCREENSHOT_FILE):
|
if not os.path.isfile(SCREENSHOT_FILE):
|
||||||
logger.info("Init screenshot file")
|
logger.info("Init screenshot file")
|
||||||
with sender.app.connection() as conn:
|
with sender.app.connection() as conn:
|
||||||
@ -304,6 +306,12 @@ def at_start(sender, **k):
|
|||||||
else:
|
else:
|
||||||
logger.info("Screenshot file already exists")
|
logger.info("Screenshot file already exists")
|
||||||
|
|
||||||
|
# cancel running tasks
|
||||||
|
from agenda_culturel.models import BatchImportation
|
||||||
|
logger.info("Cancel running importation tasks")
|
||||||
|
running_tasks = BatchImportation.objects.filter(status=BatchImportation.STATUS.RUNNING).update(status=BatchImportation.STATUS.CANCELED)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@app.task(bind=True)
|
@app.task(bind=True)
|
||||||
def run_all_recurrent_imports(self, only_fb=False):
|
def run_all_recurrent_imports(self, only_fb=False):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user