Module: Scheduler
- Defined in:
- lib/scheduler/web.rb,
lib/scheduler.rb,
lib/scheduler/clock.rb,
lib/scheduler/defer.rb,
lib/scheduler/manager.rb,
lib/scheduler/version.rb,
lib/scheduler/connection.rb,
lib/scheduler/configuration.rb,
lib/scheduler/schedule_info.rb
Overview
Based off sidetiq github.com/tobiassvn/sidetiq/blob/master/lib/sidetiq/web.rb
Defined Under Namespace
Modules: Deferrable, Schedule, Web Classes: Clock, Configuration, Connection, Defer, Manager, ScheduleInfo, SidekiqExceptionHandler
Constant Summary collapse
- VERSION =
"0.1.3"
Class Attribute Summary collapse
Class Method Summary collapse
- .configure {|configuration| ... } ⇒ Object
-
.handle_job_exception(ex, context = {}, parent_logger = nil) ⇒ Object
Log an exception.
Class Attribute Details
.configuration ⇒ Object
9 10 11 |
# File 'lib/scheduler.rb', line 9 def self.configuration @configuration ||= Configuration.new end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
13 14 15 |
# File 'lib/scheduler.rb', line 13 def self.configure yield(configuration) end |
.handle_job_exception(ex, context = {}, parent_logger = nil) ⇒ Object
Log an exception.
If your code is in a scheduled job, it is recommended to use the error_context() method in Jobs::Base to pass the job arguments and any other desired context. See app/jobs/base.rb for the error_context function.
28 29 30 31 32 33 34 35 36 |
# File 'lib/scheduler.rb', line 28 def self.handle_job_exception(ex, context = {}, parent_logger = nil) context ||= {} parent_logger ||= SidekiqExceptionHandler parent_logger.handle_exception(ex, { current_db: Scheduler::Connection.current_db, current_hostname: Scheduler::Connection.current_hostname }.merge(context)) end |