NOTE: This change is breaking only if you have workers or job-enqueueing code running in time zones other than UTC.
If unsure, check by logging the output of (java.time.ZoneId/systemDefault).
There is no need to migrate existing jobs if your infrastructure is already running in UTC. The rest of this section only applies if you have workers or job-enqueueing code running in time zones other than UTC.
If you have or enqueue jobs when this version of Proletarian goes to production, they may be processed earlier or later than intended depending on your time zone offset. You will have to decide if this is acceptable for your application. If you need precise migration, you can update existing jobs with SQL:
PostgreSQL:
-- Example for Europe/Oslo (UTC+2 in summer)
-- Adjust the timezone to match your current system timezone
UPDATE proletarian.job
SET process_at = (process_at AT TIME ZONE 'Europe/Oslo') AT TIME ZONE 'UTC';
MySQL:
-- Example for Europe/Oslo (UTC+2 in summer)
-- Adjust the timezone to match your current system timezone
UPDATE proletarian.job
SET process_at = CONVERT_TZ(process_at, 'Europe/Oslo', 'UTC');
If you need help managing the transition to UTC, please open an issue or post a message in #proletarian in the Clojurians Slack community.
Proletarian was inflexible in its handling of jobs ids. Only UUIDs were accepted, and there was no support for
database-generated job ids. A UuidSerializer protocol handled the serialization and deserialization of UUIDs (required
for MySQL support).
This new change introduces the JobIdStrategy protocol, which makes job id handling user-configurable. Its methods
generate-id, encode-id and decode-id together encapsulates job id behavior. Default implementations for UUIDs with
PostgreSQL and MySQL are provided.
This is a breaking change for anyone that uses the :proletarian/uuid-serializer config option. This option is likely
used only by MySQL users.
To upgrade, replace with :proletarian/job-id-strategy (job-id-strategies/->mysql-uuid-strategy).
on-polling-error option (#8)failed-job-fn option for handling failed jobs (9d50f2a1)proletarian.job/retry-strategy multimethod and added :proletarian/retry-strategy-fn option for
proletarian.worker/create-queue-worker (22a86fd8)proletarian.worker/process-next-job! function. This function is part of the internal machinery of the
Proletarian worker, but is being exposed as a public function for use in testing scenarios and in the REPL. (#2)handle-job! is now a function that must be passed as second argument to create-queue-worker. The
proletarian.job/handle-job! multimethod has been replaced by this.:now-fn option to enqueue! has been removed in favor of a :clock option, mirroring the create-queue-worker
options.Initial public release.
Can you improve this documentation? These fine people already did:
Martin Solli & David HarriganEdit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |