224
// This will also save one call to visibility storage and one timer task creation.
225
if !deleteAfterClose {
227
>
// however this is not true for task refresh, where now is
228
>
// the refresh time, not the close time.
229
>
// Also can't always use close time as "now" when calling the method
230
>
// as it will be used as visibilityTimestamp for immediate task and
231
>
// for emitting task_latency_queue/load metric. If close time is used
232
>
// as now, upon refresh the latency metric may see a huge value.
233
>
// TODO: remove all "now" parameters from task generator interface,
234
>
// visibility timestamp for scheduled task should be calculated from event
235
>
// or execution info in mutable state. For immediate task, visibility timestamp
236
>
// should always be when the task is generated so that task_latency_queue/load
237
>
// truly measures only task processing/loading latency.
238
>
closeTasks = append(closeTasks,
239
>
&tasks.CloseExecutionVisibilityTask{
240
>
// TaskID, VisibilityTimestamp is set by shard
241
>
WorkflowKey: r.mutableState.GetWorkflowKey(),
242
>
Version: closeVersion,
243
>
},
244
>
)
245
>
if r.archivalEnabled() {
246
retention, err := r.getRetention()
247
if err != nil {