Lines Matching +full:queue +full:- +full:tick
7 # http://www.apache.org/licenses/LICENSE-2.0
42 # ------------------------------------------------------------------------------
44 # ------------------------------------------------------------------------------
48 '''Appends a task to the deferred queue.
52 - Auditability in logs: it's easier to scrape logs and debug.
53 - Stability: an exception fails only the current task not the whole function.
54 - Reliability: The AppEngine runtime will retry failed tasks with exponential
56 - Performance: tasks are run concurrently, which is quite important given that
60 queue_name='deferred-jobs',
107 # ------------------------------------------------------------------------------
109 # ------------------------------------------------------------------------------
114 tick(handler)
117 def tick(handler): function
120 # Avoid avalanching effects due to the failsafe tick job in cron.yaml.
121 if now - last_tick < GERRIT_POLL_SEC - 1:
124 url='/controller/tick', queue_name='tick', countdown=GERRIT_POLL_SEC)
134 date_limit = (datetime.utcnow() - timedelta(days=1)).strftime('%Y-%m-%d')
144 prs_ready = change['labels'].get('Presubmit-Ready', {}).get('approved', {})
147 # account or are marked as Presubmit-Verified by a trustd account.
164 Jobs are keyed by timestamp-cl-patchset-config to get a fair schedule (workers
174 job_id = '%s--%s--%s' % (timestamp, src.replace('/', '-'), cfg_name)
190 If exists check if a Presubmit-Ready label has been added and if so updates it
204 # might have addeed a Presubmit-Ready label after we created the CL. In
206 vote_prop = req('GET', '%s/cls/%s-%s/wants_vote.json' % (DB, cl, patchset))
209 logging.info('Updating wants_vote flag on %s-%s', cl, patchset)
210 req('PUT', '%s/cls/%s-%s/wants_vote.json' % (DB, cl, patchset), body=True)
213 defer('check_pending_cl', cl_and_ps='%s-%s' % (cl, patchset))
221 src = 'cls/%s-%s' % (cl, patchset)
224 patch_obj['cls_pending/%s-%s' % (cl, patchset)] = 0
239 first_key = '%s-0' % cl
240 last_key = '%s-z' % cl
244 ps = int(cl_and_ps.split('-')[-1])
261 # Presubmit-Ready label is applied after we have finished running all the
275 age_sec = (datetime.utcnow() - t_queued).total_seconds()
284 # Remove the CL from the pending queue and update end time.
318 if '-ui-' in job_id:
322 'https://storage.googleapis.com/%s/%s/ui-test-artifacts/index.html' %
327 cl_vote = -1
338 '- %s/%s (%s)\n' % (log_url, job_id, status)
343 msg += ''.join(['- %s/%s\n' % (log_url, job_id) for job_id in passed_jobs])
345 msg += '\nArtifacts:\n' + ''.join('- %s\n' % link for link in ui_links)
347 msg += '- https://ci.perfetto.dev/#!/cls/%s\n' % cl_and_ps.split('-')[0]
350 body['labels']['Code-Review'] = cl_vote
382 time_committed = datetime.strptime(time_committed, '%Y-%m-%d %H:%M:%S')
385 src = 'branches/%s-%s' % (branch, time_committed.strftime('%Y%m%d%H%M%S'))
403 '''Deletes jobs that are left in the running queue for too long
411 age = (datetime.now() - time_started).total_seconds()
436 age_days = (datetime.now() - datetime.strptime(job_id[:8], '%Y%m%d')).days
452 'v': int((t_ended - t_queued).total_seconds())
468 'v': int((t_started - t_queued).total_seconds())
477 'v': int((t_ended - t_started).total_seconds())
493 'tick': tick,