You can now use the before_enqueue macro to preempt a job from being enqueued -- for example to prevent re-queueing a job if it's already been queued. Or if Jobs should only be run on a certain day of the week, like this:
class SomeJob < Mosquito::QueuedJob
param only_run_on : String
before_enqueue do
# true if the job should be enqueued, false if not
job.config["only_run_on"] == Time.utc.day_of_week
end
after_enqueue do
# `job.config["only_run_on"]` exists here too
end
end
fixes #130
You can now use the
before_enqueue
macro to preempt a job from being enqueued -- for example to prevent re-queueing a job if it's already been queued. Or if Jobs should only be run on a certain day of the week, like this: