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
c26acba2
Commit
c26acba2
authored
May 20, 2021
by
Andy Soiron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove PruneWebHookLogsWorker class
parent
43e7065f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
59 deletions
+0
-59
app/workers/all_queues.yml
app/workers/all_queues.yml
+0
-9
app/workers/prune_web_hook_logs_worker.rb
app/workers/prune_web_hook_logs_worker.rb
+0
-24
spec/workers/prune_web_hook_logs_worker_spec.rb
spec/workers/prune_web_hook_logs_worker_spec.rb
+0
-26
No files found.
app/workers/all_queues.yml
View file @
c26acba2
...
...
@@ -423,15 +423,6 @@
:weight:
1
:idempotent:
:tags: []
-
:name: cronjob:prune_web_hook_logs
:worker_name: PruneWebHookLogsWorker
:feature_category: :integrations
:has_external_dependencies:
:urgency: :low
:resource_boundary: :unknown
:weight:
1
:idempotent:
:tags: []
-
:name: cronjob:releases_manage_evidence
:worker_name: Releases::ManageEvidenceWorker
:feature_category: :release_evidence
...
...
app/workers/prune_web_hook_logs_worker.rb
deleted
100644 → 0
View file @
43e7065f
# frozen_string_literal: true
# Worker that deletes a fixed number of outdated rows from the "web_hook_logs"
# table.
class
PruneWebHookLogsWorker
# rubocop:disable Scalability/IdempotentWorker
include
ApplicationWorker
sidekiq_options
retry:
3
# rubocop:disable Scalability/CronWorkerContext
# This worker does not perform work scoped to a context
include
CronjobQueue
# rubocop:enable Scalability/CronWorkerContext
feature_category
:integrations
# The maximum number of rows to remove in a single job.
DELETE_LIMIT
=
50_000
def
perform
cutoff_date
=
90
.
days
.
ago
.
beginning_of_day
WebHookLog
.
created_before
(
cutoff_date
).
delete_with_limit
(
DELETE_LIMIT
)
end
end
spec/workers/prune_web_hook_logs_worker_spec.rb
deleted
100644 → 0
View file @
43e7065f
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
PruneWebHookLogsWorker
do
describe
'#perform'
do
before
do
hook
=
create
(
:project_hook
)
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
5
.
months
.
ago
)
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
4
.
months
.
ago
)
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
91
.
days
.
ago
)
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
89
.
days
.
ago
)
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
2
.
months
.
ago
)
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
1
.
month
.
ago
)
create
(
:web_hook_log
,
web_hook:
hook
,
response_status:
'404'
)
end
it
'removes all web hook logs older than 90 days'
do
described_class
.
new
.
perform
expect
(
WebHookLog
.
count
).
to
eq
(
4
)
expect
(
WebHookLog
.
last
.
response_status
).
to
eq
(
'404'
)
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