Originally created by @vandamon on GitHub (Mar 31, 2016).
This is an awesome gem, if only it can do what it says.
Crono runs my tasks, but just once, for the first time.
My cronotab looks like this:
require 'rake'
Quadra::Application.load_tasks
class InvoiceUpsert
def perform
Rake::Task['invoice:batch_upsert'].invoke
end
end
class PaymentUpsert
def perform
Rake::Task['payment:batch_upsert'].invoke
end
end
Crono.perform(PaymentUpsert).every 1.day, at: { hour: 02, min: 15 }
Crono.perform(InvoiceUpsert).every 15.minutes
Any suggestions? Or is this a bug?
Originally created by @vandamon on GitHub (Mar 31, 2016).
This is an awesome gem, if only it can do what it says.
Crono runs my tasks, but just once, for the first time.
My cronotab looks like this:
```
require 'rake'
Quadra::Application.load_tasks
class InvoiceUpsert
def perform
Rake::Task['invoice:batch_upsert'].invoke
end
end
class PaymentUpsert
def perform
Rake::Task['payment:batch_upsert'].invoke
end
end
Crono.perform(PaymentUpsert).every 1.day, at: { hour: 02, min: 15 }
Crono.perform(InvoiceUpsert).every 15.minutes
```
Any suggestions? Or is this a bug?
Try using Rake::Task#execute instead of Rake::Task#invoke.
Background: Invoke only runs the task "if needed".
Since crono doesn't boot a fresh instance of your application per job execution (like regular cronjobs would do) the task is considered als already executed after the first run if you use invoke.
@klausmeyer commented on GitHub (May 10, 2016):
Try using `Rake::Task#execute` instead of `Rake::Task#invoke`.
Background: Invoke only runs the task "if needed".
Since crono doesn't boot a fresh instance of your application per job execution (like regular cronjobs would do) the task is considered als already executed after the first run if you use `invoke`.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @vandamon on GitHub (Mar 31, 2016).
This is an awesome gem, if only it can do what it says.
Crono runs my tasks, but just once, for the first time.
My cronotab looks like this:
Any suggestions? Or is this a bug?
@Blacksmoke16 commented on GitHub (Apr 20, 2016):
+1
@klausmeyer commented on GitHub (May 10, 2016):
Try using
Rake::Task#executeinstead ofRake::Task#invoke.Background: Invoke only runs the task "if needed".
Since crono doesn't boot a fresh instance of your application per job execution (like regular cronjobs would do) the task is considered als already executed after the first run if you use
invoke.@vandamon commented on GitHub (Jun 22, 2016):
@klausmeyer Thanks a lot for the suggestion. I have it working now.