| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Implement unique job insertion in a way that's compatible with the main
Go library. Unique opts live on insert opts just like in Go, and we
copy as much of its API as possible including return result.
insert_res = client.insert(args, insert_opts: River::InsertOpts.new(
unique_opts: River::UniqueOpts.new(
by_args: true,
by_period: 15 * 60,
by_queue: true,
by_state: [River::JOB_STATE_AVAILABLE]
)
)
# contains either a newly inserted job, or an existing one if insertion was skipped
insert_res.job
# true if insertion was skipped
insert_res.unique_skipped_as_duplicated
Prepare release `v0.3.0` which largely includes unique jobs from #10. Also tweak the publishing instructions, which were once again, still somewhat wrong (building a gem doesn't lead directly to an updated `Gemfile.lock`).
Follows up #10 with a few minor reworks to the test suite. Prefer `job_args` over `args` as a variable name, and add a `job_args_to_row` helper for convenience.
| Back | FazBrowse Home | New Git URL |
Implement unique job insertion in a way that's compatible with the main
Go library. Unique opts live on insert opts just like in Go, and we
copy as much of its API as possible including return result.
insert_res = client.insert(args, insert_opts: River::InsertOpts.new( unique_opts: River::UniqueOpts.new( by_args: true, by_period: 15 * 60, by_queue: true, by_state: [River::JOB_STATE_AVAILABLE] ) ) # contains either a newly inserted job, or an existing one if insertion was skipped insert_res.job # true if insertion was skipped insert_res.unique_skipped_as_duplicated