diff --git a/proxy16/peertube/index.js b/proxy16/peertube/index.js index ffe08adea..94b220e1b 100644 --- a/proxy16/peertube/index.js +++ b/proxy16/peertube/index.js @@ -42,7 +42,6 @@ var Peertube = function (settings) { } if (!roy && host) { - console.log("ADD NEW AUTO ROY", host) roy = self.addroy([host], host, true); roy.useall = true; @@ -87,7 +86,6 @@ var Peertube = function (settings) { return Promise.resolve(r); }) .catch((e) => { - console.log(e) statistic.add({ code: e == 'failed' ? 501 : (e || {}).code || 500, difference: performance.now() - responseTime, @@ -402,8 +400,6 @@ var Peertube = function (settings) { var roy = new Roy(self); - console.log("URLS", urls) - roy.init(urls); roys[key] = roy; diff --git a/proxy16/peertube/instance.js b/proxy16/peertube/instance.js index 01c70639d..dd3c5c8a7 100644 --- a/proxy16/peertube/instance.js +++ b/proxy16/peertube/instance.js @@ -3,7 +3,6 @@ var _ = require('underscore'); var f = require('../functions'); var Statistic = require('../lib/statistic'); var instance = function (host, ip, Roy) { - console.log('new instance', host) var self = this; self.host = host; @@ -101,8 +100,6 @@ var instance = function (host, ip, Roy) { }).catch(e => { - //console.log("E", self.host, e) - return Promise.resolve() }) @@ -150,8 +147,6 @@ var instance = function (host, ip, Roy) { return Promise.reject('HOST_OFFLINE_MARKER'); } - console.log('req', `http://${host}${url}`) - try { return Roy.parent.transports.fetch(`http://${host}${url}`, { method: p.type || 'get', diff --git a/proxy16/peertube/roy.js b/proxy16/peertube/roy.js index 361f0f50e..6b34bcbf6 100644 --- a/proxy16/peertube/roy.js +++ b/proxy16/peertube/roy.js @@ -56,16 +56,12 @@ var Roy = function (parent) { if (!url) return; if (!options) options = {}; - console.log('add instance', url) - if (parent.instanses[url]){ parent.instanses[url].counter++ instances.push(parent.instanses[url].instance); - console.log('instances', instances.length) - return parent.instanses[url].instance } @@ -82,7 +78,6 @@ var Roy = function (parent) { instances.push(instance); - console.log('instances2', instances.length) parent.instanses[url] = { @@ -98,7 +93,6 @@ var Roy = function (parent) { self.removeInstance = function (host) { var instance = self.find(host); - console.log('removeInstance', host) if (instance) { @@ -129,7 +123,6 @@ var Roy = function (parent) { self.init = function (urls) { inited = true; - console.log('init', urls) _.each(urls, function (ins) { var host = ins; @@ -184,14 +177,6 @@ var Roy = function (parent) { return instance.canuse() || self.useall; }); - console.log("_beset", _.map(_instances, (i) => { - return i.host - })) - - console.log("total", _.map(instances, (i) => { - return i.host - })) - return _.sortBy(_instances, (instance) => { return getBestByType[type] @@ -261,13 +246,11 @@ var Roy = function (parent) { var list = []; if (p.host) { - console.log('get host', p.host) var instance = self.findInstanceByName(p.host); if (instance) list = [instance]; } else { list = self.bestlist(); - console.log('get best list') } } @@ -277,9 +260,7 @@ var Roy = function (parent) { var index = 0; var error = null; - console.log('list', _.map(list, (l) => { - return l.host - })) + var request = function (instance) { return instance diff --git a/proxy16/proxy.js b/proxy16/proxy.js index d17d43814..6a61d8f0d 100644 --- a/proxy16/proxy.js +++ b/proxy16/proxy.js @@ -770,13 +770,16 @@ var Proxy = function (settings, manage, test, logger, reverseproxy) { // FIXME: This is a temporary solution. Archive servers must be checked by order if (s.archived.length === 2) { + + var archiveS = {...list.archive[s.archived[0]], archiveDouble: true, cantuploading : true} + serversList.push({ ...list.archive[s.archived[0]], archiveDouble: true, }); serversList.push(list.archive[s.archived[1]]); } else { - serversList.push(list.archive[s.archived[0]]); + serversList.push({...list.archive[s.archived[0]], cantuploading : true}); } }