fix: only show update message once per day (#1742)

This commit is contained in:
Marvin Hagemeister
2023-09-06 13:11:48 +02:00
committed by GitHub
parent 20d5630534
commit 0acd1a5fc2
3 changed files with 176 additions and 15 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
import { updateCheck } from "$fresh/src/dev/update_check.ts";
import { DAY } from "$fresh/src/dev/deps.ts";
// deno-lint-ignore require-await
async function getLatestVersion() {
@@ -11,7 +12,7 @@ async function getCurrentVersion() {
return Deno.env.get("CURRENT_VERSION")!;
}
const interval = +(Deno.env.get("UPDATE_INTERVAL") ?? 1000);
const interval = +(Deno.env.get("UPDATE_INTERVAL") ?? DAY);
await updateCheck(
interval,
() => Deno.env.get("TEST_HOME")!,