Analyse: Routen fuer Portal und WOMS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
696f17b470
commit
f4c8b291d7
7 files changed
+416
-16
No files matched your search
@@ -4,7 +4,6 @@ import { config } from '../config.js'
|
||||
import { deleteDocument, getDocument, listDocuments, Query } from './appwriteAdmin.js'
|
||||
import { deleteNewsImage } from './newsImages.js'
|
||||
import { disable } from './siteFeatures.js'
|
||||
import { analyseDeps, analyseDomains } from './analyse.js'
|
||||
import { getStripe } from './stripeBilling.js'
|
||||
import { filesOf, STATUS } from './takeoverCredits.js'
|
||||
|
||||
@@ -220,18 +219,8 @@ export async function applyDeletions(plan) {
|
||||
}
|
||||
for (const id of entry.featureIds) {
|
||||
const off = await attempt('portalFeatures', id, async () => {
|
||||
const feature = await getDocument(FEATURES(), id).catch(() => null)
|
||||
// disable() meldet bei Analyse auch den Sammeldienst ab (best effort)
|
||||
await disable(id, { adminNote: 'Abgeschaltet: Aufbewahrungsfrist abgelaufen' })
|
||||
// Analyse: auch den Sammeldienst abschalten (best effort, die Daten loescht dessen 60-Tage-Job)
|
||||
if (feature?.featureKey === 'analyse' && feature.siteKey) {
|
||||
try {
|
||||
// der Sammeldienst verlangt mindestens eine Domain, auch beim Abschalten
|
||||
const project = await getDocument(config.collections.websiteProjects, feature.projectId)
|
||||
await analyseDeps.client.putSite(feature.siteKey, { projectId: feature.projectId, domains: analyseDomains(project), active: false })
|
||||
} catch (err) {
|
||||
console.warn(`[retention] Sammeldienst für Analyse ${id} nicht abgeschaltet:`, err.message)
|
||||
}
|
||||
}
|
||||
return true
|
||||
})
|
||||
if (off) deleted.features += 1
|
||||
|
||||
Reference in new issue
Block a user