mirror of
https://github.com/plashchynski/crono.git
synced 2026-04-23 09:18:44 +02:00
add skeleton
This commit is contained in:
@@ -1,2 +1,4 @@
|
|||||||
# periodicity
|
Periodicity — Job scheduler for Rails
|
||||||
Job scheduler for Rails
|
—————————————————————————————
|
||||||
|
|
||||||
|
Under Construction
|
||||||
|
|||||||
@@ -1,2 +1,7 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
|
require 'rails'
|
||||||
|
require File.expand_path("config/environment.rb")
|
||||||
|
::Rails.application.eager_load!
|
||||||
|
|
||||||
|
logger.info "Running in #{RUBY_DESCRIPTION}"
|
||||||
|
|||||||
8
lib/periodicity/extensions/active_job.rb
Normal file
8
lib/periodicity/extensions/active_job.rb
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
module Periodicity
|
||||||
|
module Extensions
|
||||||
|
class ActiveJob
|
||||||
|
def perform_every(period, *args)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
13
lib/periodicity/rails.rb
Normal file
13
lib/periodicity/rails.rb
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
module Periodicity
|
||||||
|
def self.hook_rails!
|
||||||
|
ActiveSupport.on_load(:active_job) do
|
||||||
|
extend Sidekiq::Extensions::ActiveJob
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class Rails < ::Rails::Engine
|
||||||
|
initializer 'periodicity' do
|
||||||
|
Periodicity.hook_rails!
|
||||||
|
end
|
||||||
|
end if defined?(::Rails)
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user