You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If a singleton, try to acquire a lock per workflow type.
(var locker, var locked) = await _distributedLock.TryAcquireWorkflowTypeLockAsync(workflowType);
if (locked)
{
await using var acquiredLock = locker;
// Check if this is not a workflow singleton or there's not already an halted instance on any activity.
if (!workflowType.IsSingleton || !await _workflowStore.HasHaltedInstanceAsync(workflowType.WorkflowTypeId))
{
if (_logger.IsEnabled(LogLevel.Debug))
{
_logger.LogDebug("Invoking new workflow of type '{WorkflowTypeId}' with start activity '{ActivityId}'", workflowType.WorkflowTypeId, startActivity.ActivityId);
}
await _workflowManager.StartWorkflowAsync(workflowType, startActivity);
}
}
Am I understanding this code correctly?
First the lock is acquired, and there's another check if the worklow is a singleton. So this is triggered when:
the workflow isn't a singleton
the workflow is a singleton and there's no halted instances
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Am I understanding this code correctly?
First the lock is acquired, and there's another check if the worklow is a singleton. So this is triggered when:
Beta Was this translation helpful? Give feedback.
All reactions