diff --git a/.werft/platform-delete-preview-environments-cron.ts b/.werft/platform-delete-preview-environments-cron.ts index 35779be7271df8..630aea9a680333 100644 --- a/.werft/platform-delete-preview-environments-cron.ts +++ b/.werft/platform-delete-preview-environments-cron.ts @@ -375,6 +375,11 @@ async function determineStalePreviewEnvironments(options: {previews: PreviewEnvi werft.done(SLICES.CHECKING_FOR_DB_ACTIVITY) const previewsToDelete = previews.filter((preview: PreviewEnvironment) => { + if (!previewNamespacesWithNoDBActivity.has(preview.namespace)){ + werft.log(SLICES.DETERMINING_STALE_PREVIEW_ENVIRONMENTS, `Considering ${preview.name} (${preview.namespace}) active due to recent DB activity`) + return false + } + if (!previewNamespaceBasedOnBranches.has(preview.namespace)) { werft.log(SLICES.DETERMINING_STALE_PREVIEW_ENVIRONMENTS, `Considering ${preview.name} (${preview.namespace}) stale due to missing branch`) return true