mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Delete functions which call the job statistics tasks
The JobStatistics table is going to be deleted. There are currently 3 tasks which use the JobStatistics model via the Statistics DAO, so we need to make sure that these tasks aren't being used before they are deleted in a separate PR. This commit deletes: * The `create_initial_notification_statistic_tasks` function which gets used to call the `record_initial_job_statistics` task. * The `create_outcome_notification_statistic_tasks` function which gets used to call the `record_outcome_job_statistics` task. * And the scheduling of the `timeout-job-statistics` scheduled task.
This commit is contained in:
@@ -10,20 +10,9 @@ from app.dao.statistics_dao import (
|
||||
update_job_stats_outcome_count
|
||||
)
|
||||
from app.dao.notifications_dao import get_notification_by_id
|
||||
from app.models import NOTIFICATION_STATUS_TYPES_COMPLETED
|
||||
from app.config import QueueNames
|
||||
|
||||
|
||||
def create_initial_notification_statistic_tasks(notification):
|
||||
if notification.job_id and notification.status:
|
||||
record_initial_job_statistics.apply_async((str(notification.id),), queue=QueueNames.STATISTICS)
|
||||
|
||||
|
||||
def create_outcome_notification_statistic_tasks(notification):
|
||||
if notification.job_id and notification.status in NOTIFICATION_STATUS_TYPES_COMPLETED:
|
||||
record_outcome_job_statistics.apply_async((str(notification.id),), queue=QueueNames.STATISTICS)
|
||||
|
||||
|
||||
@worker_process_shutdown.connect
|
||||
def worker_process_shutdown(sender, signal, pid, exitcode):
|
||||
current_app.logger.info('Statistics worker shutdown: PID: {} Exitcode: {}'.format(pid, exitcode))
|
||||
|
||||
Reference in New Issue
Block a user