DEV: prevents redefinition of various constants (#8199)

DEV: prevents redefinition of various constants (#8199)

CLEANUP_GRACE_PERIOD MAX_AWARDED POLL_MAILBOX_TIMEOUT_ERROR_KEY

diff --git a/app/jobs/scheduled/grant_new_user_of_the_month_badges.rb b/app/jobs/scheduled/grant_new_user_of_the_month_badges.rb
index 59fb77bc94..531fc7cb84 100644
--- a/app/jobs/scheduled/grant_new_user_of_the_month_badges.rb
+++ b/app/jobs/scheduled/grant_new_user_of_the_month_badges.rb
@@ -4,7 +4,7 @@ module Jobs
   class GrantNewUserOfTheMonthBadges < ::Jobs::Scheduled
     every 1.day
 
-    MAX_AWARDED = 2
+    MAX_AWARDED ||= 2
 
     def execute(args)
       badge = Badge.find(Badge::NewUserOfTheMonth)
diff --git a/app/jobs/scheduled/poll_mailbox.rb b/app/jobs/scheduled/poll_mailbox.rb
index 2202899483..f382e8fc8a 100644
--- a/app/jobs/scheduled/poll_mailbox.rb
+++ b/app/jobs/scheduled/poll_mailbox.rb
@@ -23,7 +23,7 @@ module Jobs
       Email::Processor.process!(popmail.pop)
     end
 
-    POLL_MAILBOX_TIMEOUT_ERROR_KEY = "poll_mailbox_timeout_error_key".freeze
+    POLL_MAILBOX_TIMEOUT_ERROR_KEY ||= "poll_mailbox_timeout_error_key".freeze
 
     def poll_pop3
       pop3 = Net::POP3.new(SiteSetting.pop3_polling_host, SiteSetting.pop3_polling_port)
diff --git a/app/jobs/scheduled/reindex_search.rb b/app/jobs/scheduled/reindex_search.rb
index 2ffb811094..c0eee8f5db 100644
--- a/app/jobs/scheduled/reindex_search.rb
+++ b/app/jobs/scheduled/reindex_search.rb
@@ -5,7 +5,7 @@ module Jobs
   class ReindexSearch < ::Jobs::Scheduled
     every 2.hours
 
-    CLEANUP_GRACE_PERIOD = 1.day.ago
+    CLEANUP_GRACE_PERIOD ||= 1.day.ago
 
     def execute(args)
       rebuild_problem_topics

GitHub sha: b6ef473a