Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Renew owned leases during long rebuilds
Renew distributed leases during paged work, abort when ownership is lost, and prevent expired workers from committing, unlocking or invalidating a successor’s completed result.
Bad example
| 1 | await scanAllPages(); await saveResult(); |
Explanation (EN)
Renew distributed leases during paged work, abort when ownership is lost, and prevent expired workers from committing, unlocking or invalidating a successor’s completed result.
Objašnjenje (HR)
Renew distributed leases during paged work, abort when ownership is lost, and prevent expired workers from committing, unlocking or invalidating a successor’s completed result.
Good example
| 1 | for await (const page of pages) { await renewOwnedLease(token); await collect(page); } await saveIfOwner(token); |
Explanation (EN)
Renew owned leases during long rebuilds
Objašnjenje (HR)
Renew owned leases during long rebuilds
Notes (EN)
Renew distributed leases during paged work, abort when ownership is lost, and prevent expired workers from committing, unlocking or invalidating a successor’s completed result.
Bilješke (HR)
Primijeniti pri promjenama cachea, fallbacka i obrade skupova podataka.
Exceptions / Tradeoffs (EN)
Lease renewal must check the ownership token atomically; never unconditionally overwrite a successor.
Iznimke / Tradeoffi (HR)
Lease renewal must check the ownership token atomically; never unconditionally overwrite a successor.