Context
From PR review discussion on lana-bank#4986.
The JobId parameter passed to spawn_unique is only meaningful on the first ever call, when no job row exists yet and the ID becomes the primary key. On every subsequent call (the common case), it's generated and silently discarded.
All callers always write job::JobId::new() — a fresh random UUID every time — which means the passed-in ID carries no semantic value. spawn_unique could simply generate the ID internally.
Current (suboptimal)
spawner.spawn_unique(job::JobId::new(), HourlyProducerJobConfig { ... }).await?;
Proposed
spawner.spawn_unique(HourlyProducerJobConfig { ... }).await?;
This would simplify the API and remove a parameter that provides no value to callers.
Related: #84
/cc @HonestMajority
Context
From PR review discussion on lana-bank#4986.
The
JobIdparameter passed tospawn_uniqueis only meaningful on the first ever call, when no job row exists yet and the ID becomes the primary key. On every subsequent call (the common case), it's generated and silently discarded.All callers always write
job::JobId::new()— a fresh random UUID every time — which means the passed-in ID carries no semantic value.spawn_uniquecould simply generate the ID internally.Current (suboptimal)
Proposed
This would simplify the API and remove a parameter that provides no value to callers.
Related: #84
/cc @HonestMajority