import * as http from "node:http"; import type * as Lark from "@larksuiteoapi/node-sdk"; import {
createFixedWindowRateLimiter,
createWebhookAnomalyTracker,
type RuntimeEnv,
WEBHOOK_ANOMALY_COUNTER_DEFAULTS as WEBHOOK_ANOMALY_COUNTER_DEFAULTS_FROM_SDK,
WEBHOOK_RATE_LIMIT_DEFAULTS as WEBHOOK_RATE_LIMIT_DEFAULTS_FROM_SDK,
} from "./monitor-state-runtime-api.js";
export const wsClients = new Map<string, Lark.WSClient>();
export const httpServers = new Map<string, http.Server>();
export const botOpenIds = new Map<string, string>();
export const botNames = new Map<string, string>();
export function stopFeishuMonitorState(accountId?: string): void { if (accountId) {
closeWsClient(wsClients.get(accountId));
wsClients.delete(accountId); const server = httpServers.get(accountId); if (server) {
server.close();
httpServers.delete(accountId);
}
botOpenIds.delete(accountId);
botNames.delete(accountId); return;
}
for (const client of wsClients.values()) {
closeWsClient(client);
}
wsClients.clear(); for (const server of httpServers.values()) {
server.close();
}
httpServers.clear();
botOpenIds.clear();
botNames.clear();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.