2018-06-27 07:23:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-04-27 10:08:57 +00:00
|
|
|
class RemoveOldWebHookLogsWorker
|
2017-11-28 16:08:30 +00:00
|
|
|
include ApplicationWorker
|
2017-04-27 10:08:57 +00:00
|
|
|
include CronjobQueue
|
|
|
|
|
|
|
|
WEB_HOOK_LOG_LIFETIME = 2.days
|
|
|
|
|
2018-08-16 12:46:40 +00:00
|
|
|
# rubocop: disable DestroyAll
|
2017-04-27 10:08:57 +00:00
|
|
|
def perform
|
|
|
|
WebHookLog.destroy_all(['created_at < ?', Time.now - WEB_HOOK_LOG_LIFETIME])
|
|
|
|
end
|
2018-08-16 12:46:40 +00:00
|
|
|
# rubocop: enable DestroyAll
|
2017-04-27 10:08:57 +00:00
|
|
|
end
|