Class: RocketJob::Jobs::DirmonJob

Inherits:
RocketJob::Job show all
Includes:
Plugins::Cron
Defined in:
lib/rocket_job/jobs/dirmon_job.rb

Overview

Notes:

  • Jobs that do not implement #upload must have either ‘upload_file_name` or `full_file_name` as an attribute.

With RocketJob Pro, the file is automatically uploaded into the job itself using the job’s #upload method, after which the file is archived or deleted if no archive_directory was specified in the DirmonEntry.

To start Dirmon for the first time

RocketJob::Jobs::DirmonJob.create!

If another DirmonJob instance is already queued or running, then the create above will fail with:

Validation failed: State Another instance of this job is already queued or running

Or to start DirmonJob and ignore errors if already running

RocketJob::Jobs::DirmonJob.create

Instance Method Summary collapse

Methods included from Plugins::Cron

#rocket_job_cron_set_run_at

Methods included from Plugins::Job::Throttle

#throttle_filter_class, #throttle_filter_id

Methods included from Plugins::Job::Worker

#fail_on_exception!, #perform_now, #rocket_job_active_workers, #rocket_job_work

Methods included from Plugins::Job::StateMachine

#pausable?

Methods included from Plugins::Job::Persistence

#create_restart!, #reload, #save_with_retry!

Methods included from Plugins::Job::Model

#as_json, #duration, #expired?, #run_now!, #scheduled?, #scheduled_at, #seconds, #sleeping?, #status, #worker_count, #worker_names, #worker_on_server?

Instance Method Details

#performObject

Checks the directories for new files, starting jobs if files have not changed since the last run.



53
54
55
# File 'lib/rocket_job/jobs/dirmon_job.rb', line 53

def perform
  check_directories
end