plashchynski / crono

A time-based background job scheduler daemon (just like Cron) for Rails
https://github.com/plashchynski/crono
Apache License 2.0
687 stars 56 forks source link

Crono not working with Ruby 3.0 #105

Closed trustarun closed 2 years ago

trustarun commented 2 years ago

I am using below env:

Ruby -> 3.0.0p0 Rails -> 6.1.6 Crono -> 2.0.0

I am getting below error while running the Test job mentioned in its document:

I, [2022-07-01T20:34:39.036394 #4638] INFO -- : Perform Test E, [2022-07-01T20:34:39.037945 #4638] ERROR -- : Finished Test in 0.00 seconds with error: wrong number of arguments (given 1, expected 0)

The job I have defined in crontab as per its doc ` require 'rake'

Rails.app_class.load_tasks

class Test def perform Rake::Task['crono:hello'].execute end end

Crono.perform(Test).every 5.seconds`

I have aslo define the rake task in lib/tasks/test.rake as needed namespace :crono do desc 'Update all tables' task :hello => :environment do puts "hello" end end

Do we have any way to fix this? My application heavily based on job scheduling and this issue of crono with Ruby 3.0 preventing me from upgrading my app to Ruby 3