aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-08-20 16:59:25 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-08-20 17:11:38 +0200
commit1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1 (patch)
tree1a2601d63152da4906335c6116ba5f1e8992af33 /server/lib
parente861452fb26553177ad4e32bfb18b4fd8a5b1816 (diff)
downloadPeerTube-1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1.tar.gz
PeerTube-1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1.tar.zst
PeerTube-1e2564d3927ce4ca4ca9a09930da6da7ebb4e9a1.zip
Server: make friends urls come from the request instead of the
configuration file
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/friends.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/server/lib/friends.js b/server/lib/friends.js
index 6a2c37fd7..667055d4c 100644
--- a/server/lib/friends.js
+++ b/server/lib/friends.js
@@ -1,6 +1,5 @@
1'use strict' 1'use strict'
2 2
3const config = require('config')
4const each = require('async/each') 3const each = require('async/each')
5const eachLimit = require('async/eachLimit') 4const eachLimit = require('async/eachLimit')
6const eachSeries = require('async/eachSeries') 5const eachSeries = require('async/eachSeries')
@@ -44,7 +43,7 @@ function getMyCertificate (callback) {
44 fs.readFile(constants.CONFIG.STORAGE.CERT_DIR + 'peertube.pub', 'utf8', callback) 43 fs.readFile(constants.CONFIG.STORAGE.CERT_DIR + 'peertube.pub', 'utf8', callback)
45} 44}
46 45
47function makeFriends (callback) { 46function makeFriends (urls, callback) {
48 const podsScore = {} 47 const podsScore = {}
49 48
50 logger.info('Make friends!') 49 logger.info('Make friends!')
@@ -54,8 +53,6 @@ function makeFriends (callback) {
54 return callback(err) 53 return callback(err)
55 } 54 }
56 55
57 const urls = config.get('network.friends')
58
59 eachSeries(urls, function (url, callbackEach) { 56 eachSeries(urls, function (url, callbackEach) {
60 computeForeignPodsList(url, podsScore, callbackEach) 57 computeForeignPodsList(url, podsScore, callbackEach)
61 }, function (err) { 58 }, function (err) {