167
var errForRelease error
168
if releaseLeaseWithError {
169
>
// If the workflow context needs to be cleared, operation error passed to Release func (default).
api.go
170
>
// Otherwise, leave it nil here to avoid clearing the workflow context (but still return error to the caller).
171
>
errForRelease = retError
172
>
}
173
if retError != nil && currentWorkflowTask != nil && currentWorkflowTask.Type == enumsspb.WORKFLOW_TASK_TYPE_SPECULATIVE && ms.IsStickyTaskQueueSet() {
174
// If, while completing WFT, error is occurred and returned to the worker then worker will clear its cache.