Merge pull request #2239 from alphagov/remove-unused-task

Remove unused task
This commit is contained in:
Rebecca Law
2018-11-28 13:45:28 +00:00
committed by GitHub
4 changed files with 0 additions and 37 deletions

View File

@@ -35,7 +35,6 @@ from app.dao.inbound_sms_dao import dao_get_inbound_sms_by_id
from app.dao.jobs_dao import (
dao_update_job,
dao_get_job_by_id,
dao_update_job_status
)
from app.dao.notifications_dao import (
get_notification_by_id,
@@ -59,7 +58,6 @@ from app.models import (
JOB_STATUS_FINISHED,
JOB_STATUS_IN_PROGRESS,
JOB_STATUS_PENDING,
JOB_STATUS_ERROR,
KEY_TYPE_NORMAL,
LETTER_TYPE,
NOTIFICATION_CREATED,
@@ -342,13 +340,6 @@ def save_letter(
handle_exception(self, notification, notification_id, e)
@notify_celery.task(bind=True, name='update-letter-job-to-error')
@statsd(namespace="tasks")
def update_dvla_job_to_error(self, job_id):
dao_update_job_status(job_id, JOB_STATUS_ERROR)
current_app.logger.info("Updated {} job to {}".format(job_id, JOB_STATUS_ERROR))
@notify_celery.task(bind=True, name='update-letter-notifications-to-sent')
@statsd(namespace="tasks")
def update_letter_notifications_to_sent_to_dvla(self, notification_references):

View File

@@ -115,11 +115,6 @@ def dao_update_job(job):
db.session.commit()
def dao_update_job_status(job_id, status):
db.session.query(Job).filter_by(id=job_id).update({'job_status': status})
db.session.commit()
def dao_get_jobs_older_than_limited_by(job_types, older_than=7, limit_days=2):
end_date = datetime.utcnow() - timedelta(days=older_than)
start_date = end_date - timedelta(days=limit_days)