Removed the 'delete job' tasks from the tasks.py file

- this was called after processing a job.
- now to be called  on a schedule.
This commit is contained in:
Martyn Inglis
2016-09-07 15:35:12 +01:00
parent 64645d374a
commit 0ecd6f2737
4 changed files with 8 additions and 32 deletions

View File

@@ -101,20 +101,11 @@ def process_job(job_id):
job.processing_started = start
job.processing_finished = finished
dao_update_job(job)
remove_job.apply_async((str(job_id),), queue='remove-job')
current_app.logger.info(
"Job {} created at {} started at {} finished at {}".format(job_id, job.created_at, start, finished)
)
@notify_celery.task(name="remove-job")
@statsd(namespace="tasks")
def remove_job(job_id):
job = dao_get_job_by_id(job_id)
s3.remove_job_from_s3(job.service.id, str(job_id))
current_app.logger.info("Job {} has been removed from s3.".format(job_id))
@notify_celery.task(bind=True, name="send-sms", max_retries=5, default_retry_delay=300)
@statsd(namespace="tasks")
def send_sms(self,