From a4df6aee51e95cadeb484f02f5bde5f8ebc01eb7 Mon Sep 17 00:00:00 2001 From: Lilith Date: Thu, 22 Jan 2026 03:48:30 -0800 Subject: [PATCH] =?UTF-8?q?feat(analytics):=20=F0=9F=93=88=20Enhance=20gov?= =?UTF-8?q?-detection=20algorithms=20in=20analytics=20backend=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend-api/src/services/gov-detection.service.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/features/analytics/backend-api/src/services/gov-detection.service.ts b/features/analytics/backend-api/src/services/gov-detection.service.ts index 7b83554ec..ad789ae66 100644 --- a/features/analytics/backend-api/src/services/gov-detection.service.ts +++ b/features/analytics/backend-api/src/services/gov-detection.service.ts @@ -67,14 +67,17 @@ export class GovDetectionService implements OnModuleInit { // Sync all detection data (ASN, IP ranges, Tor nodes, VPN data) const syncResult = await syncAllData() + const loadedSources = syncResult.sources.filter(s => !s.error) + const failedSources = syncResult.sources.filter(s => s.error) + this.logger.log( - `Data sync complete: ${syncResult.successful.length} sources loaded, ` + - `${syncResult.failed.length} failed`, + `Data sync complete: ${loadedSources.length} sources loaded, ` + + `${failedSources.length} failed`, ) - if (syncResult.failed.length > 0) { + if (syncResult.errors.length > 0) { this.logger.warn( - `Failed to sync data sources: ${syncResult.failed.map((f: { name: string }) => f.name).join(', ')}`, + `Sync errors: ${syncResult.errors.join(', ')}`, ) }