Fix for the job status

- It seems that when we changed the name of the job.status column that we didn't update the code to use job.job_status.
- Therefore none of the jobs since then have had the job status updated.
- Now that this is fix we can show the job status when there is an error like "sending exceeds limits"
  - This could happen if a job is scheduled to run at the top of the hour, so at the time of the job creation the limit was not exceed, but at the time of processing the job the limit is exceed.
This commit is contained in:
Rebecca Law
2016-10-05 14:56:32 +01:00
parent 8aca768c30
commit 6065ed57cf
2 changed files with 12 additions and 12 deletions

View File

@@ -41,7 +41,7 @@ def process_job(job_id):
total_sent = fetch_todays_total_message_count(service.id)
if total_sent + job.notification_count > service.message_limit:
job.status = 'sending limits exceeded'
job.job_status = 'sending limits exceeded'
job.processing_finished = datetime.utcnow()
dao_update_job(job)
current_app.logger.info(
@@ -50,7 +50,7 @@ def process_job(job_id):
)
return
job.status = 'in progress'
job.job_status = 'in progress'
dao_update_job(job)
template = Template(
@@ -94,7 +94,7 @@ def process_job(job_id):
)
finished = datetime.utcnow()
job.status = 'finished'
job.job_status = 'finished'
job.processing_started = start
job.processing_finished = finished
dao_update_job(job)