From 4a88523eab82c24139674cac471fda2003fd4bc7 Mon Sep 17 00:00:00 2001 From: HF Date: Mon, 27 Jun 2022 11:27:37 +0200 Subject: [PATCH] spraed out tileserver timeouts --- src/core/tileserver.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/tileserver.js b/src/core/tileserver.js index 74f081e..a9ab4f6 100644 --- a/src/core/tileserver.js +++ b/src/core/tileserver.js @@ -165,12 +165,17 @@ class CanvasUpdater { logger.info( `Tiling: Set interval for zoomlevel ${c} update to ${timeout / 1000}`, ); - setInterval(this.updateZoomlevelTiles, timeout, c); + setTimeout(() => { + setInterval(this.updateZoomlevelTiles, timeout, c); + }, Math.floor(Math.random() * timeout)); } if (this.maxTiledZoom === 0) { // in the case of canvasSize == 256 this.TileLoadingQueues.push([]); - setInterval(this.updateZoomlevelTiles, 5 * 60 * 1000, 0); + const timeout = 5 * 60 * 1000; + setTimeout(() => { + setInterval(this.updateZoomlevelTiles, timeout, 0); + }, Math.floor(Math.random() * timeout)); } } }