feat(source2): lock dark mode, sans-serif typography, and all recent updates
This commit is contained in:
1 parent
dd4c8f6876
commit
9f24b56e97
259 files changed
+15596
-8966
No files matched your search
@@ -1,22 +1,22 @@
|
||||
// proxy/dataRetention.js
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// Pruning process for BackOne MongoDB data retention.
|
||||
// Removes telemetry records older than 7 days to conserve database space.
|
||||
// Removes telemetry records older than 30 days to conserve database space.
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
const mongoose = require('mongoose');
|
||||
const Schemas = require('./models/Schemas');
|
||||
|
||||
/**
|
||||
* Prune all time-series documents older than 7 days.
|
||||
* Prune all time-series documents older than 30 days.
|
||||
*/
|
||||
async function pruneOldData() {
|
||||
const thirtyDaysAgo = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000);
|
||||
const timeString = thirtyDaysAgo.toLocaleString('id-ID', { timeZone: 'Asia/Jakarta' }) + ' WIB';
|
||||
console.log(`[Collector] [Retention] Checking for telemetry data older than 30 days (before ${timeString})...`);
|
||||
|
||||
// Prune from all collections in Schemas except CustomDeviceLabel
|
||||
const collections = Object.keys(Schemas).filter(name => name !== 'CustomDeviceLabel');
|
||||
// Prune from all collections in Schemas except CustomDeviceLabel, AgentRegistry, TenantConfig
|
||||
const collections = Object.keys(Schemas).filter(name => name !== 'CustomDeviceLabel' && name !== 'AgentRegistry' && name !== 'TenantConfig');
|
||||
|
||||
for (const name of collections) {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user