$this.fluidbook.cache.set('_loadbalancingServerURL', $this._loadbalancingServerURL);
}, 15000);
- $.ajax("https://toolbox.fluidbook.com/lb.json").done(function (data) {
- $this.loadbalancing = data;
+ $.ajax("https://toolbox.fluidbook.com/lbw.json").done(function (data) {
+ $this.loadbalancing = [];
+ $.each(data, function (i, server) {
+ $.ajax('https://' + server.h + '/status.txt', {dataType: 'text'}).done(function (data) {
+ if (data == '1') {
+ for (let i = 0; i < server.w; i++) {
+ $this.loadbalancing.push(server.h);
+ }
+ }
+ });
+ });
$this.loadShades(callback);
}).fail(function () {
$this.loadbalancing = false;
},
getURL(url) {
- if (!this.loadbalancing || this.checkExcludedFromLoadBalancing(url)) {
+ if (!this.loadbalancing || this.loadbalancing.length === 0 || this.checkExcludedFromLoadBalancing(url)) {
return url;
}