Skip to content

Commit 02ed896

Browse files
committed
Merge pull request #197 from just3ws/master
In production the arguments to sidekiq are being cast to string
2 parents d7e20f9 + f8f5f08 commit 02ed896

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/workers/protip_mailer_popular_protips_worker.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ class ProtipMailerPopularProtipsWorker
33
sidekiq_options queue: :low
44

55
def perform(from, to)
6+
7+
# In development the arguments are the correct type but in production
8+
# they have to be recast from string back to date types :D
9+
from = Time.zone.parse(from.to_s)
10+
to = Time.zone.parse(to.to_s)
11+
612
protips = ProtipMailer::Queries.popular_protips(from, to)
713

814
User.find_each(batch_size: 100) do |user|

0 commit comments

Comments
 (0)