Skip to content

Commit

Permalink
Merge pull request #64 from nestauk/perform-now
Browse files Browse the repository at this point in the history
Activate delayed job
  • Loading branch information
cdccollins authored Dec 19, 2024
2 parents 5ef3239 + 4016f82 commit 4b68232
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions app/jobs/send_bulk_message_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ class SendBulkMessageJob < ApplicationJob
def perform(users)
message_jobs = users.map { |user| SendMessageJob.new(user) }

message_jobs.each do |job|
job.perform_now
end
ActiveJob.perform_all_later(message_jobs)
end
end
2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class Application < Rails::Application
# Common ones are `templates`, `generators`, or `middleware`, for example.
config.autoload_lib(ignore: %w[assets tasks])

config.active_job.queue_adapter = :delayed_job

# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
Expand Down
2 changes: 1 addition & 1 deletion test/lib/scheduler_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require "rake"

class SchedulerTest < ActiveSupport::TestCase
include ActiveJob::TestHelper
# include ActiveJob::QueueAdapters::DelayedJobAdapter

setup do
ENV["WEEKLY_MESSAGE_DAY"] = "1"
Expand Down

0 comments on commit 4b68232

Please sign in to comment.