feat(analytics): 📈 Enhance gov-detection algorithms in analytics backend API

This commit is contained in:
Lilith 2026-01-22 03:48:30 -08:00
parent 46bbdcd49f
commit a4df6aee51

View file

@ -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(', ')}`,
)
}