From 163c143d41accf8454e37c812a753abb22e86e18 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 15 Sep 2023 11:14:26 +0200 Subject: [PATCH] wait #6269 @0.25 --- js/libs/fluidbook/fluidbook.loader.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.loader.js b/js/libs/fluidbook/fluidbook.loader.js index 9b9e37f1..661bbb4b 100644 --- a/js/libs/fluidbook/fluidbook.loader.js +++ b/js/libs/fluidbook/fluidbook.loader.js @@ -18,6 +18,7 @@ function FluidbookLoader(fluidbook) { this.imageMimeType = this.format === 'jpg' ? 'image/jpeg' : 'image/png'; this._needSeparateTextures = []; this.loadbalancing = false; + this._loadbalancingServerURL = []; } FluidbookLoader.prototype = { @@ -734,8 +735,10 @@ FluidbookLoader.prototype = { if (!this.loadbalancing) { return url; } - let server = this.loadbalancing[Math.floor(Math.random() * this.loadbalancing.length)]; - return 'https://' + server + '/' + this.fluidbook.settings.id + '_' + this.fluidbook.settings.hash + '/' + url; + if(this._loadbalancingServerURL[url]===undefined){ + this._loadbalancingServerURL[url]=this.loadbalancing[Math.floor(Math.random() * this.loadbalancing.length)]; + } + return 'https://' + this._loadbalancingServerURL[url] + '/' + this.fluidbook.settings.id + '_' + this.fluidbook.settings.hash + '/' + url; }, getTexture: function (page, callback, enter) { -- 2.39.5