Put the statistics tasks into a new queue. This currently has no worker in PaaS so blocks the deployment until new PaaS worker is configured.

This commit is contained in:
Martyn Inglis
2017-05-09 22:03:13 +01:00
parent caed193647
commit a4549a2e26
3 changed files with 16 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ def test_should_create_initial_job_task_if_notification_is_related_to_a_job(
mock = mocker.patch("app.celery.statistics_tasks.record_initial_job_statistics.apply_async")
notification = sample_notification(notify_db, notify_db_session, job=sample_job)
create_initial_notification_statistic_tasks(notification)
mock.assert_called_once_with((str(notification.id), ), queue="notify")
mock.assert_called_once_with((str(notification.id), ), queue="statistics")
def test_should_not_create_initial_job_task_if_notification_is_related_to_a_job(
@@ -31,7 +31,7 @@ def test_should_create_outcome_job_task_if_notification_is_related_to_a_job(
mock = mocker.patch("app.celery.statistics_tasks.record_outcome_job_statistics.apply_async")
notification = sample_notification(notify_db, notify_db_session, job=sample_job)
create_outcome_notification_statistic_tasks(notification)
mock.assert_called_once_with((str(notification.id), ), queue="notify")
mock.assert_called_once_with((str(notification.id), ), queue="statistics")
def test_should_not_create_outcome_job_task_if_notification_is_related_to_a_job(
@@ -42,7 +42,6 @@ def test_should_not_create_outcome_job_task_if_notification_is_related_to_a_job(
mock.assert_not_called()
def test_should_call_create_job_stats_dao_methods(notify_db, notify_db_session, sample_notification, mocker):
dao_mock = mocker.patch("app.celery.statistics_tasks.create_or_update_job_sending_statistics")
record_initial_job_statistics(str(sample_notification.id))