Sha256: 2bff1ebedebf2511d2c45210237593ef0bd8bd3e6134ea6b4a8e351d59e7ae1f

Contents?: true

Size: 689 Bytes

Versions: 7

Compression:

Stored size: 689 Bytes

Contents

module Marty
  module Jobs
    module Schedule
      extend Delorean::Functions

      delorean_fn :call do
        glob = Rails.root.join('app/jobs/**/*_job.rb')
        Dir.glob(glob).sort.each { |f| require f }

        glob2 = Marty.root.join('app/jobs/**/*_job.rb')
        Dir.glob(glob2).sort.each { |f| require f }

        Delayed::Job.where.not(cron: nil).each(&:destroy!)

        Marty::BackgroundJob::Schedule.all.map do |schedule|
          Marty::BackgroundJob::UpdateSchedule.call(
            id: schedule.id,
            job_class: schedule.job_class,
          )

          [schedule.job_class, schedule.arguments, schedule.cron]
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
marty-14.3.0 app/services/marty/jobs/schedule.rb
marty-14.0.0 app/services/marty/jobs/schedule.rb
marty-13.0.2 app/services/marty/jobs/schedule.rb
marty-11.0.0 app/services/marty/jobs/schedule.rb
marty-10.0.3 app/services/marty/jobs/schedule.rb
marty-10.0.2 app/services/marty/jobs/schedule.rb
marty-10.0.0 app/services/marty/jobs/schedule.rb