gitlab-org--gitlab-foss/app/workers/remove_old_web_hook_logs_wo...

15 lines
318 B
Ruby

# 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