DEV: Use string timestamp when enqueuing update_top_redirection (#15826)

Job arguments go via JSON, and so DateTime objects will appear as strings in the Job's `#execute` method. The latest version of Sidekiq has started warning about this to reduce developer confusion.
This commit is contained in:
David Taylor 2022-02-04 23:14:35 +00:00 committed by GitHub
parent f53d70ac63
commit 5d82a695d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ class UserOption < ActiveRecord::Base
Discourse.redis.expire(key, delay)
# delay the update
Jobs.enqueue_in(delay / 2, :update_top_redirection, user_id: self.user_id, redirected_at: Time.zone.now)
Jobs.enqueue_in(delay / 2, :update_top_redirection, user_id: self.user_id, redirected_at: Time.zone.now.to_s)
end
def should_be_redirected_to_top