Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
93103bb0
Commit
93103bb0
authored
May 02, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rescue stale live traces
parent
610a8f24
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
app/workers/all_queues.yml
app/workers/all_queues.yml
+1
-0
app/workers/fource_archive_stale_live_trace_worker.rb
app/workers/fource_archive_stale_live_trace_worker.rb
+23
-0
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+3
-0
No files found.
app/workers/all_queues.yml
View file @
93103bb0
...
...
@@ -17,6 +17,7 @@
-
cronjob:stuck_ci_jobs
-
cronjob:stuck_import_jobs
-
cronjob:stuck_merge_jobs
-
cronjob:fource_archive_stale_live_trace
-
cronjob:trending_projects
-
cronjob:issue_due_scheduler
...
...
app/workers/fource_archive_stale_live_trace_worker.rb
0 → 100644
View file @
93103bb0
class
FourceArchiveStaleLiveTraceWorker
include
ApplicationWorker
include
CronjobQueue
def
perform
# Find jobs with the following condition
# - Finished 4 hours ago (Jobs finished 4 hours ago should have an archived trace)
# - Not archived yet (Because ArchiveTraceWorker failed by some reason)
Ci
::
Build
.
finished
.
where
(
'finished_at < ?'
,
4
.
hours
.
ago
)
.
where
(
'NOT EXISTS (?)'
,
Ci
::
JobArtifact
.
select
(
1
).
trace
.
where
(
'ci_builds.id = ci_job_artifacts.job_id'
))
.
find_each
(
batch_size:
1000
)
do
|
job
|
begin
job
.
trace
.
archive!
rescue
=>
e
Rails
.
logger
.
error
"
#{
job
.
id
}
: Failed to archive stable live trace:
#{
e
.
message
}
"
end
Rails
.
logger
.
warning
"
#{
job
.
id
}
: Live trace was force archived because it was considered as stale"
end
end
end
end
config/initializers/1_settings.rb
View file @
93103bb0
...
...
@@ -289,6 +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'
][
'cron'
]
||=
'0 * * * *'
Settings
.
cron_jobs
[
'import_export_project_cleanup_worker'
][
'job_class'
]
=
'ImportExportProjectCleanupWorker'
Settings
.
cron_jobs
[
'fource_archive_stale_live_trace_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'fource_archive_stale_live_trace_worker'
][
'cron'
]
||=
'*/4 * * * *'
Settings
.
cron_jobs
[
'fource_archive_stale_live_trace_worker'
][
'job_class'
]
=
'BuildTraceChunkArchiveStaleObjectsWorker'
Settings
.
cron_jobs
[
'requests_profiles_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'requests_profiles_worker'
][
'cron'
]
||=
'0 0 * * *'
Settings
.
cron_jobs
[
'requests_profiles_worker'
][
'job_class'
]
=
'RequestsProfilesWorker'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment