debian-mirror-gitlab/app/services/web_hooks/log_destroy_service.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
398 B
Ruby
Raw Normal View History

2022-07-23 23:45:48 +05:30
# frozen_string_literal: true
module WebHooks
class LogDestroyService
BATCH_SIZE = 1000
def initialize(web_hook_id)
@web_hook_id = web_hook_id
end
def execute
next while WebHookLog.delete_batch_for(@web_hook_id, batch_size: BATCH_SIZE)
ServiceResponse.success
rescue StandardError => ex
ServiceResponse.error(message: ex.message)
end
end
end