250
ns *namespace.Namespace,
251
entry *persistence.TaskQueueUserDataEntry,
253
>
// Only consider build ids that have been active at least as long as the retention time.
254
>
// This assumes that when a build ID is added, it's used soon afterwards.
255
>
// This lets us avoid making visibility queries that would probably find some workflows.
256
>
retention := ns.Retention()
257
>
// Don't consider build ids that were recently the default, since there may be workers
258
>
// still processing tasks or data that hasn't made it to visibility yet.
259
>
removableBuildIdDurationSinceDefault := a.removableBuildIdDurationSinceDefault()
260
>
261
>
versioningData := entry.UserData.Data.GetVersioningData()
262
>
var buildIdsToRemove []string
263
>
for setIdx, set := range versioningData.GetVersionSets() {
264
// Note that setActive counts build ids that may have associated workflows, i.e. not
265
// just all with STATE_ACTIVE. Also note that we always examine the default build ID