Jitter tweaks

This commit is contained in:
Zef Hemel
2025-09-13 17:21:23 +02:00
parent a56007ef77
commit efe5087d93
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -154,6 +154,6 @@ export function safeRun(fn: () => Promise<void>) {
/** /**
* Generates a random delay between 0 and 1000 milliseconds. * Generates a random delay between 0 and 1000 milliseconds.
*/ */
export function jitter() { export function jitter(maxLength = 1000) {
return Math.floor(Math.random() * 1000); return Math.floor(Math.random() * maxLength);
} }
+1 -1
View File
@@ -10,7 +10,7 @@ import {
type Path, type Path,
} from "@silverbulletmd/silverbullet/lib/ref"; } from "@silverbulletmd/silverbullet/lib/ref";
const pageWatchInterval = 4000; const pageWatchInterval = 3000; // + jitter
export class Space { export class Space {
// We do watch files in the background to detect changes // We do watch files in the background to detect changes