fix: ping urls are not reset when restarting (#924)

This commit is contained in:
Meier Lukas
2024-08-08 20:36:51 +02:00
committed by GitHub
parent f9e2df085b
commit 365e267b8d
3 changed files with 20 additions and 1 deletions
+8 -1
View File
@@ -5,7 +5,14 @@ import { pingChannel, pingUrlChannel } from "@homarr/redis";
import { createCronJob } from "../lib";
export const pingJob = createCronJob("ping", EVERY_MINUTE).withCallback(async () => {
const resetPreviousUrlsAsync = async () => {
await pingUrlChannel.clearAsync();
logger.info("Cleared previous ping urls");
};
export const pingJob = createCronJob("ping", EVERY_MINUTE, {
beforeStart: resetPreviousUrlsAsync,
}).withCallback(async () => {
const urls = await pingUrlChannel.getAllAsync();
for (const url of new Set(urls)) {