Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `queue_adapter_name' for nil #196

Closed
zaychoer opened this issue Apr 1, 2024 · 3 comments
Closed

undefined method `queue_adapter_name' for nil #196

zaychoer opened this issue Apr 1, 2024 · 3 comments

Comments

@zaychoer
Copy link

zaychoer commented Apr 1, 2024

am I missing setup for recurring tasks ?

[SolidQueue] Starting Dispatcher(pid=59501, hostname=zaychos-MacBook-Air.local, metadata={:polling_interval=>1, :batch_size=>500, :concurrency_maintenance_interval=>600, :recurring_schedule=>nil})
[SolidQueue] Starting Dispatcher(pid=59502, hostname=zaychos-MacBook-Air.local, metadata={:polling_interval=>1, :batch_size=>500, :concurrency_maintenance_interval=>600, :recurring_schedule=>{ :settlement_process=>{:schedule=>"42 10 * * *", :class_name=>"SettlementHandlerJob", :arguments=>[]}, :disbursement_process=>{:schedule=>"43 10 * * *", :class_name=>"DisbursementHandlerJob", :arguments=>[]}}})
[SolidQueue] Starting Worker(pid=59503, hostname=zaychos-MacBook-Air.local, metadata={:polling_interval=>0.1, :queues=>"*", :thread_pool_size=>5})

[SolidQueue] undefined method `queue_adapter_name' for nil
[SolidQueue] undefined method `queue_adapter_name' for nil
[SolidQueue] undefined method `queue_adapter_name' for nil

i have already added solid_queue to the application configuration and followed the documentation.
other tasks are running well, except for the recurring task.

config.active_job.queue_adapter = :solid_queue

here is solid_queue.yml

default: &default
  dispatchers:
    - polling_interval: 1
      batch_size: 500
    - recurring_tasks:
        settlement_process:
          class: "SettlementHandlerJob"
          schedule: "42 10 * * *" 
        disbursement_process:
          class: "DisbursementHandlerJob"
          schedule: "43 10 * * *" 
  workers:
    - queues: "*"
      threads: 5
      processes: 1
      polling_interval: 0.1

development:
 <<: *default

sandbox:
 <<: *default

test:
 <<: *default

production:
 <<: *default


@rosa
Copy link
Member

rosa commented Apr 1, 2024

Hey @zaychoer thanks for reporting this! This looks like an scenario I'm not handling gracefully 😅 Is it possible one/some of your recurring task classes doesn't exist in your app? From these:

class: "SettlementHandlerJob"
class: "DisbursementHandlerJob"

Can you open a Rails console and see if they're defined?

@zaychoer
Copy link
Author

zaychoer commented Apr 2, 2024

Hey @zaychoer thanks for reporting this! This looks like an scenario I'm not handling gracefully 😅 Is it possible one/some of your recurring task classes doesn't exist in your app? From these:

class: "SettlementHandlerJob"
class: "DisbursementHandlerJob"

Can you open a Rails console and see if they're defined?

Hey, @rosa , that was my mistake. After checking, I realized that the task class was inside a directory. After adding the directory name before the task class, it ran well. Here is the fixed configuration:

dispatchers:
    - polling_interval: 1
      batch_size: 500
    - recurring_tasks:
        settlement_process:
          class: "Bank::SettlementHandlerJob"
          schedule: "42 10 * * *" 
        disbursement_process:
          class: "Bank::DisbursementHandlerJob"
          schedule: "43 10 * * *" 

@zaychoer zaychoer closed this as completed Apr 2, 2024
@rosa
Copy link
Member

rosa commented Apr 2, 2024

Oh, great @zaychoer, thanks a lot for checking and confirming! 🙏 I'll make sure this case is handled better, and you get a better error or warning about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants