Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Report scheduled job outcomes separately from process success
Distinguish a lease-skipped job from a completed unchanged refresh and a published update in structured logs or metrics.
Bad example
| 1 | await synchronize(); |
| 2 | logger.info('Refresh completed'); |
Explanation (EN)
Distinguish a lease-skipped job from a completed unchanged refresh and a published update in structured logs or metrics.
Objašnjenje (HR)
U logu razlikuj preskoceni posao, uspjesno osvjezavanje bez promjene i objavljene promjene. Exit 0 sam po sebi ne dokazuje svjezinu podataka.
Good example
| 1 | const outcome = await synchronize(); |
| 2 | logger.info('Refresh run finished', { outcome }); |
Explanation (EN)
For scheduled workers, process exit zero can mean safe contention rather than fresh data. Return a small explicit outcome from the service and propagate it through runtime logging. An unchanged complete fetch can refresh successful-sync time, while a skipped run cannot. Monitor persisted freshness independently from process liveness, and test lease contention and successful no-change imports.
Objašnjenje (HR)
U logu razlikuj preskoceni posao, uspjesno osvjezavanje bez promjene i objavljene promjene. Exit 0 sam po sebi ne dokazuje svjezinu podataka.
Notes (EN)
For scheduled workers, process exit zero can mean safe contention rather than fresh data. Return a small explicit outcome from the service and propagate it through runtime logging. An unchanged complete fetch can refresh successful-sync time, while a skipped run cannot. Monitor persisted freshness independently from process liveness, and test lease contention and successful no-change imports.
Bilješke (HR)
U logu razlikuj preskoceni posao, uspjesno osvjezavanje bez promjene i objavljene promjene. Exit 0 sam po sebi ne dokazuje svjezinu podataka.
Exceptions / Tradeoffs (EN)
If skipping is impossible, a separate skipped state is unnecessary. Existing metrics with equivalent semantics can supply the same signal without a new return type.
Iznimke / Tradeoffi (HR)
Primijeni u opisanom kontekstu uz navedene iznimke.