Closed 34code closed 2 years ago
@34code that configuration looks correct. I tried loading it locally and it looks like it's appearing correctly for me.
Hmm. If this is in development, have you restarted your webserver since adding the configuration?
wow, thanks for the quick response. Yes I've tried restarting the rails server in dev and also restarted good_job with
good_job start --enable-cron=true
Not sure if i should be putting the config in application.rb or development.rb ..
I'm also using Ruby 3.1.0 and Rails 7.0.1
You raised the issue at a good time; at least for the moment :-)
What's displayed on the GoodJob Dashboard comes down to whatever Rails.application.configuration.good_job.cron
's hash value is on the webserver that's rendering the dashboard.
You could try opening a rails console and seeing what the value is.
hmm.. seems like mine is returning way too much in rails console.. its over 10k lines
I'll try with a fresh rails install becasue this was a hacky upgrade from rails 6.1
@34code any progress? That's really weird that the result would be so long. The configuration value should be exactly what you configured in your application.rb
.
I can confirm that its working in rails 7 .. seems like i have some config issues in my rails 6.1.0 project. Will need to gradually migrate to rails 7 anyway so this was a good forcing function.
hmm.. after I migrated some more of my code over to the new rails 7 project, I'm back in this bind..
Running Rails.application.configuration.good_job.cron
yields NoMethodError: undefined method
configuration' for #<Botflip7::Application...` in console
I was working well until I added in sassc and some other frontend-related gems :(
Oops, sorry the prefix is Rails.application.config
/ Rails.configuration
. e.g. Rails.application.config.good_job.cron
hmm.. that seems to render the hash properly. I'm stumped.
{:walmart_etl_arts_crafts=>
{:cron=>"30 19 * * *",
:class=>"Etl::Walmart::ArtsCrafts",
:args=>
[{:etl_dir=>"arts_crafts",
:ftp_path=>"/Users/sambit/Documents/RAILS/Staging/etl",
:temp_path=>"/tmp",
:filename=>"Walmart-arts-crafts-sewing_IR.txt.gz",
:category=>"Arts & Crafts"}]}}
Hmmm. Here's my calendar if you wanted to find a time together to look at the code. I'm really curious and eager to help: https://calendly.com/bensheldon/office-hours
Thanks so much for the offer, @bensheldon ! I swear I did nothing different (except maybe moving the cron task from development.rb to application.rb), but now its showing up :)
Would still love to chat about how I can help with this project however I can be of help.. and some scale related questions (not that my project will run into scale issues anytime soon) out of curiosity.
I followed the instructions to add cron schedule as follows in application.rb
but the dashboard doesn't seem to reflect this job..