You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL`SELECT d.id, cf.content_hash FROM deployments d left join content_files cf on cf.deployment = d.id WHERE d.entity_type = 'profile' AND entity_timestamp < ${oldProfileSince} LIMIT ${PROFILE_CLEANUP_LIMIT}`,
70
+
SQL`SELECT d.id, cf.content_hash
71
+
FROM deployments d
72
+
LEFT JOIN content_files cf on cf.deployment = d.id
73
+
WHERE d.entity_type = 'profile'
74
+
AND entity_timestamp < ${oldProfileSince}
75
+
AND NOT EXISTS (
76
+
SELECT 1 FROM active_pointers ap
77
+
WHERE ap.entity_id = d.entity_id
78
+
AND ap.pointer ~ '^default[0-9]+$'
79
+
)
80
+
LIMIT ${PROFILE_CLEANUP_LIMIT}`,
71
81
'gc_old_profiles_query_old_deployments'
72
82
)
73
83
@@ -134,7 +144,13 @@ export class GarbageCollectionManager {
134
144
this.LOGGER.info('Running clear old profiles process')
SQL`DELETE FROM active_pointers ap USING deployments d WHERE d.entity_id = ap.entity_id AND entity_type = 'profile' AND entity_timestamp < ${oldProfileSince} RETURNING ap.pointer`,
0 commit comments