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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
536c1e40
Commit
536c1e40
authored
Dec 06, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove RemoveOldWebHookLogsWorker
parent
40343096
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
37 deletions
+5
-37
app/workers/all_queues.yml
app/workers/all_queues.yml
+0
-1
app/workers/remove_old_web_hook_logs_worker.rb
app/workers/remove_old_web_hook_logs_worker.rb
+0
-14
changelogs/unreleased/dm-remove-prune-web-hook-logs-worker.yml
...elogs/unreleased/dm-remove-prune-web-hook-logs-worker.yml
+5
-0
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+0
-4
spec/workers/remove_old_web_hook_logs_worker_spec.rb
spec/workers/remove_old_web_hook_logs_worker_spec.rb
+0
-18
No files found.
app/workers/all_queues.yml
View file @
536c1e40
...
...
@@ -10,7 +10,6 @@
-
cronjob:prune_old_events
-
cronjob:remove_expired_group_links
-
cronjob:remove_expired_members
-
cronjob:remove_old_web_hook_logs
-
cronjob:remove_unreferenced_lfs_objects
-
cronjob:repository_archive_cache
-
cronjob:repository_check_dispatch
...
...
app/workers/remove_old_web_hook_logs_worker.rb
deleted
100644 → 0
View file @
40343096
# frozen_string_literal: true
class
RemoveOldWebHookLogsWorker
include
ApplicationWorker
include
CronjobQueue
WEB_HOOK_LOG_LIFETIME
=
2
.
days
# rubocop: disable DestroyAll
def
perform
WebHookLog
.
destroy_all
([
'created_at < ?'
,
Time
.
now
-
WEB_HOOK_LOG_LIFETIME
])
end
# rubocop: enable DestroyAll
end
changelogs/unreleased/dm-remove-prune-web-hook-logs-worker.yml
0 → 100644
View file @
536c1e40
---
title
:
Remove old webhook logs after 90 days, as documented, instead of after
2
merge_request
:
author
:
type
:
fixed
config/initializers/1_settings.rb
View file @
536c1e40
...
...
@@ -302,10 +302,6 @@ Settings.cron_jobs['gitlab_usage_ping_worker'] ||= Settingslogic.new({})
Settings
.
cron_jobs
[
'gitlab_usage_ping_worker'
][
'cron'
]
||=
Settings
.
__send__
(
:cron_for_usage_ping
)
Settings
.
cron_jobs
[
'gitlab_usage_ping_worker'
][
'job_class'
]
=
'GitlabUsagePingWorker'
Settings
.
cron_jobs
[
'remove_old_web_hook_logs_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'remove_old_web_hook_logs_worker'
][
'cron'
]
||=
'40 0 * * *'
Settings
.
cron_jobs
[
'remove_old_web_hook_logs_worker'
][
'job_class'
]
=
'RemoveOldWebHookLogsWorker'
Settings
.
cron_jobs
[
'stuck_merge_jobs_worker'
]
||=
Settingslogic
.
new
({})
Settings
.
cron_jobs
[
'stuck_merge_jobs_worker'
][
'cron'
]
||=
'0 */2 * * *'
Settings
.
cron_jobs
[
'stuck_merge_jobs_worker'
][
'job_class'
]
=
'StuckMergeJobsWorker'
...
...
spec/workers/remove_old_web_hook_logs_worker_spec.rb
deleted
100644 → 0
View file @
40343096
require
'spec_helper'
describe
RemoveOldWebHookLogsWorker
do
subject
{
described_class
.
new
}
describe
'#perform'
do
let!
(
:week_old_record
)
{
create
(
:web_hook_log
,
created_at:
Time
.
now
-
1
.
week
)
}
let!
(
:three_days_old_record
)
{
create
(
:web_hook_log
,
created_at:
Time
.
now
-
3
.
days
)
}
let!
(
:one_day_old_record
)
{
create
(
:web_hook_log
,
created_at:
Time
.
now
-
1
.
day
)
}
it
'removes web hook logs older than 2 days'
do
subject
.
perform
expect
(
WebHookLog
.
all
).
to
include
(
one_day_old_record
)
expect
(
WebHookLog
.
all
).
not_to
include
(
week_old_record
,
three_days_old_record
)
end
end
end
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