DEV: prevent initialized constant warning
Was tired of seeing the following warnings in the logs ``` /discourse/app/jobs/scheduled/old_keys_reminder.rb:7: warning: already initialized constant Jobs::OldKeysReminder::OLD_CREDENTIALS_PERIOD /discourse/app/jobs/scheduled/old_keys_reminder.rb:7: warning: previous definition of OLD_CREDENTIALS_PERIOD was here ```
This commit is contained in:
parent
8de635fe92
commit
3f59d0cffe
|
@ -4,12 +4,13 @@ module Jobs
|
|||
class OldKeysReminder < ::Jobs::Scheduled
|
||||
every 1.month
|
||||
|
||||
OLD_CREDENTIALS_PERIOD = 2.years
|
||||
OLD_CREDENTIALS_PERIOD ||= 2.years
|
||||
|
||||
def execute(_args)
|
||||
return if SiteSetting.send_old_credential_reminder_days.to_i == 0
|
||||
return if message_exists?
|
||||
return if old_site_settings_keys.blank? && old_api_keys.blank?
|
||||
|
||||
PostCreator.create!(
|
||||
Discourse.system_user,
|
||||
title: title,
|
||||
|
|
Loading…
Reference in New Issue