Enhancements
-
[Oban] Allow setting a MFA in
:get_dynamic_repo
Anonymous functions don't work with OTP releases, as anonymous functions cannot be used in configuration. Now a MFA tuple can be passed instead of a fun, and the scaling guide recommends a function instead.
-
[Cron] Include configured timezone in cron job metadata
Along with the cron expression, stored as
cron_expr
, the configured timezone is also recorded ascron_tz
in cron job metadata. -
[Cron] Add
next_at/2
andlast_at/2
for cron time calculationsThis implements jumping functions for cron expressions. Rather than naively iterating through minutes, it uses the expression values to efficiently jump to the next or last cron run time.
-
[Executor] Always convert
queue_time
to native time unitThe telemetry docs state that measurements are recorded in
native
time units. However, that hasn't been the case forqueue_time
for a while now. It usually worked anyway native and nanosecond is of the same resolution, but now it is guaranteed.
Bug Fixes
-
[Peer] Correct leadership elections for the
Dolphin
engineMySQL always returns the number of entries attempted, even when nothing was added. The previous match caused all nodes to believe they were the leader. This uses a secondary query within the same transaction to detect if the current instance is the leader.
-
[Reindexer] Drop invalid indexes concurrently when reindexing.
The
DROP INDEX
query would lock the whole table with anACCESS EXCLUSIVE
lock and could cause queries to fail unexpectedly. -
[Testing] Use
Ecto.Type.cast/2
for backward compatibilityThe
cast!/2
function wasn't added until Ecto 3.12. This reverts time casting to usecast/2
for compatibility with earlier Ecto versions. -
[Worker] Validate that the
unique
option isn't an empty list.An empty list was accepted at compile time, but wouldn't be valid later at runtime. Now the two validations match for greater parity.