Commit 10acdc30 authored by Shinya Maeda's avatar Shinya Maeda

Rename find_stale. Fix worker name in declaration.

parent fb1e35e5
...@@ -52,7 +52,7 @@ module Ci ...@@ -52,7 +52,7 @@ module Ci
end end
# Find stale live traces and return their build ids # Find stale live traces and return their build ids
def find_stale(finished_before: 1.hour.ago) def find_stale_in_batches(finished_before: 1.hour.ago)
include(EachBatch) include(EachBatch)
.select(:build_id) .select(:build_id)
.group(:build_id) .group(:build_id)
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
- cronjob:stuck_ci_jobs - cronjob:stuck_ci_jobs
- cronjob:stuck_import_jobs - cronjob:stuck_import_jobs
- cronjob:stuck_merge_jobs - cronjob:stuck_merge_jobs
- cronjob:rescue_stale_live_trace - cronjob:ci_rescue_stale_live_trace
- cronjob:trending_projects - cronjob:trending_projects
- cronjob:issue_due_scheduler - cronjob:issue_due_scheduler
......
...@@ -9,7 +9,7 @@ module Ci ...@@ -9,7 +9,7 @@ module Ci
# The targets are jobs with the following conditions # The targets are jobs with the following conditions
# - Jobs had been finished 1 hour ago, but they don't have an archived trace yet # - Jobs had been finished 1 hour ago, but they don't have an archived trace yet
# This could happen when their sidekiq-jobs are lost by SIGKILL # This could happen when their sidekiq-jobs are lost by SIGKILL
Ci::BuildTraceChunk.find_stale(finished_before: 1.hour.ago) do |build_ids| Ci::BuildTraceChunk.find_stale_in_batches(finished_before: 1.hour.ago) do |build_ids|
Ci::Build.where(id: build_ids).find_each do |build| Ci::Build.where(id: build_ids).find_each do |build|
begin begin
build.trace.archive! build.trace.archive!
......
...@@ -289,9 +289,9 @@ Settings.cron_jobs['repository_archive_cache_worker']['job_class'] = 'Repository ...@@ -289,9 +289,9 @@ Settings.cron_jobs['repository_archive_cache_worker']['job_class'] = 'Repository
Settings.cron_jobs['import_export_project_cleanup_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['import_export_project_cleanup_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['import_export_project_cleanup_worker']['cron'] ||= '0 * * * *' Settings.cron_jobs['import_export_project_cleanup_worker']['cron'] ||= '0 * * * *'
Settings.cron_jobs['import_export_project_cleanup_worker']['job_class'] = 'ImportExportProjectCleanupWorker' Settings.cron_jobs['import_export_project_cleanup_worker']['job_class'] = 'ImportExportProjectCleanupWorker'
Settings.cron_jobs['rescue_stale_live_trace_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['ci_rescue_stale_live_trace_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['rescue_stale_live_trace_worker']['cron'] ||= '17 * * * *' Settings.cron_jobs['ci_rescue_stale_live_trace_worker']['cron'] ||= '17 * * * *'
Settings.cron_jobs['rescue_stale_live_trace_worker']['job_class'] = 'RescueStaleLiveTraceWorker' Settings.cron_jobs['ci_rescue_stale_live_trace_worker']['job_class'] = 'RescueStaleLiveTraceWorker'
Settings.cron_jobs['requests_profiles_worker'] ||= Settingslogic.new({}) Settings.cron_jobs['requests_profiles_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['requests_profiles_worker']['cron'] ||= '0 0 * * *' Settings.cron_jobs['requests_profiles_worker']['cron'] ||= '0 0 * * *'
Settings.cron_jobs['requests_profiles_worker']['job_class'] = 'RequestsProfilesWorker' Settings.cron_jobs['requests_profiles_worker']['job_class'] = 'RequestsProfilesWorker'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment