mirror of
https://github.com/PreMiD/PreMiD.git
synced 2026-04-06 04:41:58 +02:00
chore: disable ip stuff for now
This commit is contained in:
@@ -23,8 +23,13 @@ export class ClearableGaugeMetric {
|
||||
this.data.set(key, { value, attributes });
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.data.clear();
|
||||
clear({ except }: { except?: string[] }) {
|
||||
for (const key of this.data.keys()) {
|
||||
if (except && except.includes(key))
|
||||
continue;
|
||||
|
||||
this.data.delete(key);
|
||||
}
|
||||
}
|
||||
|
||||
toMetricData(): GaugeMetricData {
|
||||
|
||||
@@ -23,7 +23,7 @@ export async function lookupIp(ip: string): Promise<{ latitude: number; longitud
|
||||
}
|
||||
}
|
||||
|
||||
let reloading: Promise<void> | undefined;
|
||||
let reloading: Promise<void> | undefined = Promise.resolve();
|
||||
let log: debug.Debugger | undefined;
|
||||
|
||||
export async function reloadIpLocationApi() {
|
||||
|
||||
@@ -37,7 +37,7 @@ export async function updateActivePresenceGauge() {
|
||||
} while (cursor !== "0");
|
||||
|
||||
// Clear previous data
|
||||
activePresenceGauge.clear();
|
||||
activePresenceGauge.clear({ except: [...serviceCounts.keys()] });
|
||||
|
||||
// Set new data
|
||||
for (const [serviceVersion, count] of serviceCounts.entries()) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import createRedis from "./functions/createRedis.js";
|
||||
import { setSessionCounter } from "./functions/setSessionCounter.js";
|
||||
import "./tracing.js";
|
||||
import { updateActivePresenceGauge } from "./functions/updateActivePresenceGauge.js";
|
||||
import { reloadIpLocationApi } from "./functions/lookupIp.js";
|
||||
// import { reloadIpLocationApi } from "./functions/lookupIp.js";
|
||||
import { cleanupOldUserData } from "./functions/cleanupOldUserData.js";
|
||||
|
||||
export const redis = createRedis();
|
||||
@@ -45,18 +45,18 @@ void new CronJob(
|
||||
true,
|
||||
);
|
||||
|
||||
void new CronJob(
|
||||
// Every day at 9am
|
||||
"0 9 * * *",
|
||||
() => {
|
||||
reloadIpLocationApi();
|
||||
},
|
||||
undefined,
|
||||
true,
|
||||
undefined,
|
||||
undefined,
|
||||
true,
|
||||
);
|
||||
// void new CronJob(
|
||||
// // Every day at 9am
|
||||
// "0 9 * * *",
|
||||
// () => {
|
||||
// reloadIpLocationApi();
|
||||
// },
|
||||
// undefined,
|
||||
// true,
|
||||
// undefined,
|
||||
// undefined,
|
||||
// true,
|
||||
// );
|
||||
|
||||
void new CronJob(
|
||||
// Every day at 1am
|
||||
|
||||
Reference in New Issue
Block a user