From 8f2e237879532b1d5a8d42d93c4bb894f1e83afe Mon Sep 17 00:00:00 2001 From: Michal Migurski Date: Mon, 17 Apr 2017 15:27:37 -0700 Subject: [PATCH] Writing webhook-sourced jobs to a second tasks queue --- openaddr/ci/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openaddr/ci/__init__.py b/openaddr/ci/__init__.py index 8f0c1354..3485189e 100644 --- a/openaddr/ci/__init__.py +++ b/openaddr/ci/__init__.py @@ -56,6 +56,9 @@ def truthy(value): TASK_QUEUE, DONE_QUEUE, DUE_QUEUE, HEARTBEAT_QUEUE = 'tasks', 'finished', 'due', 'heartbeat' +# A second queue to accept webhook-sourced jobs, for testing the Docker branch. +TASK_QUEUE_2 = 'tasks2' + # Additional delay after JOB_TIMEOUT for due tasks. DUETASK_DELAY = timedelta(minutes=5) @@ -771,6 +774,8 @@ def add_files_to_queue(queue, job_id, job_url, files, commit_sha, rerun): delay = timedelta(seconds=len(tasks)) queue.put(task.asdata(), expected_at=td2str(delay)) + other_queue = db_queue(queue.conn, TASK_QUEUE_2) + other_queue.put(task.asdata(), expected_at=td2str(delay)) tasks[file_id] = file_name return tasks