releaseRunExecution method

  1. @override
Future<void> releaseRunExecution(
  1. String runId, {
  2. required String executionId,
})
override

Releases a lease only when executionId is still current.

Implementation

@override
Future<void> releaseRunExecution(
  String runId, {
  required String executionId,
}) async {
  final state = _runs[runId];
  if (state == null || state.executionId != executionId) return;
  _runs[runId] = state.copyWith(
    ownerId: null,
    leaseExpiresAt: null,
    updatedAt: _clock.now(),
  );
}