Sha256: 2546d68470ad6828d6ee29d5821b2bf43f88a66c7200a1b7f1c10db554087692

Contents?: true

Size: 552 Bytes

Versions: 4

Compression:

Stored size: 552 Bytes

Contents

module Marty
  module Jobs
    module Schedule
      extend Delorean::Functions

      delorean_fn :call, sig: 0 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::CronJob.subclasses.map do |klass|
          klass.schedule
          [klass.name, klass.cron_expression]
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
marty-9.5.1 app/services/marty/jobs/schedule.rb
marty-9.5.0 app/services/marty/jobs/schedule.rb
marty-9.3.3 app/services/marty/jobs/schedule.rb
marty-9.3.2 app/services/marty/jobs/schedule.rb