Class: RocketJob::Jobs::DirmonJob
- Inherits:
-
RocketJob::Job
- Object
- RocketJob::Job
- RocketJob::Jobs::DirmonJob
- Includes:
- Plugins::Restart, Plugins::Singleton
- Defined in:
- lib/rocket_job/jobs/dirmon_job.rb
Overview
Note:
-
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:
MongoMapper::DocumentNotValid: 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
-
#perform ⇒ Object
Iterate over each Dirmon entry looking for new files If a new file is found, it is not processed immediately, instead it is passed to the next run of this job along with the file size.
Methods included from Plugins::Job::Throttle
#throttle_filter_class, #throttle_filter_id
Methods included from Plugins::Job::Worker
#perform_now, #rocket_job_active_workers, #rocket_job_fail_on_exception!, #rocket_job_work
Methods included from Plugins::Job::Persistence
Methods included from Plugins::Job::Model
#as_json, #collect_nil_output?, #collect_output?, #duration, #expired?, #scheduled?, #seconds, #status, #worker_on_server?
Instance Method Details
#perform ⇒ Object
Iterate over each Dirmon entry looking for new files If a new file is found, it is not processed immediately, instead it is passed to the next run of this job along with the file size. If the file size has not changed, the Job is kicked off.
57 58 59 |
# File 'lib/rocket_job/jobs/dirmon_job.rb', line 57 def perform check_directories end |