unique

command
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

README

Unique jobs

Insert the same account sync twice with UniqueOpts{ByArgFields: ["account_id"], ByPeriod: time.Hour}; the second insert returns the first job.

docker compose -f deploy/docker-compose.yml up -d --wait postgres  # Postgres on localhost:55432
go run ./examples/unique                                           # safe to rerun

Account ids above 2^53 that differ in the last digit stay distinct.

Default FOREMAN_DATABASE_URL: postgres://foreman:foreman@localhost:55432/foreman?sslmode=disable.

Expected output

second insert: duplicate skipped: true (job 1)
another account: duplicate skipped: false

Documentation

Overview

Command unique inserts the same unique job twice.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL