mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-03 01:06:39 +00:00
Rename olm offline
This commit is contained in:
@@ -13,7 +13,7 @@ const OFFLINE_THRESHOLD_MS = 2 * 60 * 1000; // 2 minutes
|
|||||||
* Starts the background interval that checks for clients that haven't pinged recently
|
* Starts the background interval that checks for clients that haven't pinged recently
|
||||||
* and marks them as offline
|
* and marks them as offline
|
||||||
*/
|
*/
|
||||||
export const startOfflineChecker = (): void => {
|
export const startOlmOfflineChecker = (): void => {
|
||||||
if (offlineCheckerInterval) {
|
if (offlineCheckerInterval) {
|
||||||
return; // Already running
|
return; // Already running
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ export const startOfflineChecker = (): void => {
|
|||||||
/**
|
/**
|
||||||
* Stops the background interval that checks for offline clients
|
* Stops the background interval that checks for offline clients
|
||||||
*/
|
*/
|
||||||
export const stopOfflineChecker = (): void => {
|
export const stopOlmOfflineChecker = (): void => {
|
||||||
if (offlineCheckerInterval) {
|
if (offlineCheckerInterval) {
|
||||||
clearInterval(offlineCheckerInterval);
|
clearInterval(offlineCheckerInterval);
|
||||||
offlineCheckerInterval = null;
|
offlineCheckerInterval = null;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
handleOlmRegisterMessage,
|
handleOlmRegisterMessage,
|
||||||
handleOlmRelayMessage,
|
handleOlmRelayMessage,
|
||||||
handleOlmPingMessage,
|
handleOlmPingMessage,
|
||||||
startOfflineChecker
|
startOlmOfflineChecker
|
||||||
} from "../olm";
|
} from "../olm";
|
||||||
import { MessageHandler } from "./ws";
|
import { MessageHandler } from "./ws";
|
||||||
|
|
||||||
@@ -26,4 +26,4 @@ export const messageHandlers: Record<string, MessageHandler> = {
|
|||||||
"newt/ping/request": handleNewtPingRequestMessage,
|
"newt/ping/request": handleNewtPingRequestMessage,
|
||||||
};
|
};
|
||||||
|
|
||||||
startOfflineChecker(); // this is to handle the offline check for olms
|
startOlmOfflineChecker(); // this is to handle the offline check for olms
|
||||||
|
|||||||
Reference in New Issue
Block a user