Skip to content

Commit

Permalink
Don't background send
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed May 29, 2024
1 parent 9191c35 commit 9c9a3c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
16 changes: 0 additions & 16 deletions app/jobs/entry_job.rb

This file was deleted.

4 changes: 2 additions & 2 deletions lib/tasks/entry.rake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace :entry do
# rake entry:send_entries_test
task :send_entries_test => :environment do
user = User.where(:email=>"[email protected]").first
EntryJob.perform_later(user.id, Inspiration.random.id, 0)
EntryMailer.send_entry(user, Inspiration.random).deliver_now
end

# TRIGGERED MANUALLY
Expand Down Expand Up @@ -186,7 +186,7 @@ namespace :entry do
if user.is_free? && user.emails_sent > 6 && user.entries.count == 0 && ENV['FREE_WEEK'] != 'true'
user.update_columns(frequency: [], previous_frequency: user.frequency)
elsif user.is_pro? || (user.is_free? && Time.now.strftime("%U").to_i % 2 == 0) || ENV['FREE_WEEK'] == 'true' # Every other week for free users
EntryJob.perform_later(user.id, random_inspiration.id, sent_in_hour)
EntryMailer.send_entry(user, random_inspiration).deliver_now
sent_in_hour += 1
end
rescue => error
Expand Down

0 comments on commit 9c9a3c6

Please sign in to comment.