Skip to content

Commit a88ecea

Browse files
unknownunknown
unknown
authored and
unknown
committed
changed settings for delayed job to test in prod
1 parent 7357895 commit a88ecea

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lib/activity_tracking_notification.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ def initialize
66

77
def perform
88
week_day = Time.now.wday
9-
User.all(:conditions => ["(id % 7) = ?", week_day]).each do |user|
9+
#User.all(:conditions => ["(id % 7) = ?", week_day]).each do |user|
10+
User.all.each do |user|
1011
next if !user.email_notification?
1112
events = user.find_tracked_events(7.days.ago)
1213
next if events.blank? #if there are no events to send per email, then get the hell out
@@ -30,6 +31,7 @@ def perform
3031

3132
user.deliver_activity_tracking_email!(question_events, tags, events - question_events)
3233
end
33-
Delayed::Job.enqueue ActivityTrackingNotification.new, 0, Time.now.tomorrow.midnight
34+
#Delayed::Job.enqueue ActivityTrackingNotification.new, 0, Time.now.tomorrow.midnight
35+
Delayed::Job.enqueue ActivityTrackingNotification.new, 0, 20.min.from_now
3436
end
3537
end

lib/tasks/initialize_jobs.rake

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ namespace :jobs do
33
task :initialize => :environment do
44
# Deletes old delayed Jobs and starts a new one for the activity tracking email sending
55
Delayed::Job.destroy_all
6-
Delayed::Job.enqueue ActivityTrackingNotification.new, 0, Time.now.tomorrow.midnight
6+
#Delayed::Job.enqueue ActivityTrackingNotification.new, 0, Time.now.tomorrow.midnight
7+
Delayed::Job.enqueue ActivityTrackingNotification.new, 0, 20.min.from_now
78
end
89
end

script/delayed_job

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
44
require 'delayed/command'
55
Delayed::Command.new(ARGV).daemonize
6-
Delayed::Job.enqueue ActivityTrackingNotification.new, 0, Time.now.tomorrow.midnight

0 commit comments

Comments
 (0)