88
}
89
90
>
func (a *Activities) EnsureNoExecutionsAdvVisibilityActivity(ctx context.Context, nsID namespace.ID, nsName namespace.Name, notDeletedCount int) error {
activities.go
91
>
ctx = headers.SetCallerName(ctx, nsName.String())
92
>
93
>
logger := log.With(a.logger,
94
>
tag.WorkflowNamespace(nsName.String()),
95
>
tag.WorkflowNamespaceID(nsID.String()))
96
>
97
>
req := &manager.CountWorkflowExecutionsRequest{
98
>
NamespaceID: nsID,
99
>
Namespace: nsName,
100
>
Query: sadefs.QueryWithAnyNamespaceDivision(""),
101
>
}
102
>
resp, err := a.visibilityManager.CountWorkflowExecutions(ctx, req)
103
>
if err != nil {
104
logger.Error("Unable to count workflow executions.", tag.Error(err))
105
return err
106
}
107
109
>
if count > notDeletedCount {
110
activityInfo := activity.GetInfo(ctx)
111
// Starting from the 8th attempt (after ~127s), workflow executions deletion must show some progress.