Skip to content

Commit

Permalink
remove "upload" status from archive (#1265)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgithubprofile authored Aug 12, 2024
1 parent 9051828 commit bd8dbf8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 30 deletions.
4 changes: 0 additions & 4 deletions proxy16/peertube/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -402,8 +400,6 @@ var Peertube = function (settings) {

var roy = new Roy(self);

console.log("URLS", urls)

roy.init(urls);

roys[key] = roy;
Expand Down
5 changes: 0 additions & 5 deletions proxy16/peertube/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -101,8 +100,6 @@ var instance = function (host, ip, Roy) {

}).catch(e => {

//console.log("E", self.host, e)

return Promise.resolve()

})
Expand Down Expand Up @@ -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',
Expand Down
21 changes: 1 addition & 20 deletions proxy16/peertube/roy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -82,7 +78,6 @@ var Roy = function (parent) {

instances.push(instance);

console.log('instances2', instances.length)


parent.instanses[url] = {
Expand All @@ -98,7 +93,6 @@ var Roy = function (parent) {
self.removeInstance = function (host) {
var instance = self.find(host);

console.log('removeInstance', host)

if (instance) {

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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')

}
}
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion proxy16/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});
}
}

Expand Down

0 comments on commit bd8dbf8

Please sign in to comment.