62
}
63
64
>
func (a *LocalActivities) CountExecutionsAdvVisibilityActivity(ctx context.Context, nsID namespace.ID, nsName namespace.Name) (int64, error) {
activities.go
65
>
ctx = headers.SetCallerName(ctx, nsName.String())
66
>
67
>
logger := log.With(a.logger,
68
>
tag.WorkflowNamespace(nsName.String()),
69
>
tag.WorkflowNamespaceID(nsID.String()))
70
>
71
>
req := &manager.CountWorkflowExecutionsRequest{
72
>
NamespaceID: nsID,
73
>
Namespace: nsName,
74
>
Query: sadefs.QueryWithAnyNamespaceDivision(""),
75
>
}
76
>
resp, err := a.visibilityManager.CountWorkflowExecutions(ctx, req)
77
>
if err != nil {
78
logger.Error("Unable to count workflow executions.", tag.Error(err))
79
return 0, err
80
}
81
83
>
logger.Info("There are some workflows in namespace.", tag.Counter(int(resp.Count)))
84
>
} else {
85
logger.Info("There are no workflows in namespace.")
86
}
88
}
89