282
workflowCtx = item.wfContext
283
} else {
284
>
metrics.CacheMissCounter.With(handler).Record(1)
cache.go
285
>
workflowCtx = workflow.NewContext(
286
>
shardContext.GetConfig(),
287
>
cacheKey.WorkflowKey,
288
>
archetypeID,
289
>
shardContext.GetLogger(),
290
>
shardContext.GetThrottledLogger(),
291
>
shardContext.GetMetricsHandler(),
292
>
)
293
>
294
>
var err error
295
>
value := &cacheItem{shardId: shardContext.GetShardID(), wfContext: workflowCtx, finalizer: shardContext.GetFinalizer()}
296
>
existing, err := c.PutIfNotExist(cacheKey, value)
297
>
if err != nil {
298
metrics.CacheFailures.With(handler).Record(1)
299
return nil, nil, err
300
}
301
//nolint:revive
302
>
workflowCtx = existing.(*cacheItem).wfContext
cache.go
303
}
304