Open kaka-ruto opened 1 month ago
I like this idea. To solve this for now I created a generic Job that allows me to pass rake tasks in as the argument:
# frozen_string_literal: true
class RakeTaskJob < ApplicationJob
queue_as :default
def perform(command)
require "rake"
Rake.application.init
Rake.application.load_rakefile
Rake::Task[command].invoke
end
end
Then I can just do this in recurring.yml
:
monday_job:
class: RakeTaskJob
args: "scheduled_tasks:monday_jobs"
schedule: every Monday at 7am UTC
Would you be open to supporting rake tasks in recurring jobs?
Something like this
I can give it a jab.