Table of Contents

Method RenewLeasesAsync

Namespace
Millrace.Storage
Assembly
Millrace.dll

RenewLeasesAsync(string, IReadOnlyList<JobId>, TimeSpan, CancellationToken)

Extends leases for in-flight jobs; returns the ids actually renewed.

ValueTask<IReadOnlyList<JobId>> RenewLeasesAsync(string workerId, IReadOnlyList<JobId> jobs, TimeSpan lease, CancellationToken ct)

Parameters

workerId string
jobs IReadOnlyList<JobId>
lease TimeSpan
ct CancellationToken

Returns

ValueTask<IReadOnlyList<JobId>>

Remarks

Renewed iff State == Processing && WorkerId == workerId — LeaseUntil is NOT consulted: an expired-but-unreclaimed lease IS renewable (resurrection), atomically per job against concurrent ClaimAsync(ClaimRequest, CancellationToken) (whichever commits first wins). Ownership ends only when another claim changes WorkerId/Attempt. The result additionally excludes ids whose CancelRequested is set — the worker disambiguates via GetJobAsync(JobId, CancellationToken).