seyfert/vendor/gateway/shard/stopHeartbeating.ts
2022-06-21 20:25:17 -05:00

10 lines
366 B
TypeScript

import { Shard } from "./types.ts";
export function stopHeartbeating(shard: Shard): void {
// Clear the regular heartbeat interval.
clearInterval(shard.heart.intervalId);
// It's possible that the Shard got closed before the first jittered heartbeat.
// To go safe we should clear the related timeout too.
clearTimeout(shard.heart.timeoutId);
}