diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-02-05 18:03:20 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-02-05 18:03:20 +0100 |
commit | dac0a5319ab1c52a0958647b1593f85339b77e29 (patch) | |
tree | 716bc9e7e0b9fd3a7066530e50e73991fb278d05 /lib/friends.js | |
parent | a5fa04b0cce851f680a45055f57ed2c3d22f1c82 (diff) | |
download | PeerTube-dac0a5319ab1c52a0958647b1593f85339b77e29.tar.gz PeerTube-dac0a5319ab1c52a0958647b1593f85339b77e29.tar.zst PeerTube-dac0a5319ab1c52a0958647b1593f85339b77e29.zip |
Split utils file
Diffstat (limited to 'lib/friends.js')
-rw-r--r-- | lib/friends.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/friends.js b/lib/friends.js index e093c85c4..b0086a38b 100644 --- a/lib/friends.js +++ b/lib/friends.js | |||
@@ -8,10 +8,11 @@ | |||
8 | 8 | ||
9 | var constants = require('../initializers/constants') | 9 | var constants = require('../initializers/constants') |
10 | var logger = require('../helpers/logger') | 10 | var logger = require('../helpers/logger') |
11 | var peertubeCrypto = require('../helpers/peertubeCrypto') | ||
11 | var Pods = require('../models/pods') | 12 | var Pods = require('../models/pods') |
12 | var PoolRequests = require('../models/poolRequests') | 13 | var PoolRequests = require('../models/poolRequests') |
13 | var poolRequests = require('../lib/poolRequests') | 14 | var poolRequests = require('../lib/poolRequests') |
14 | var utils = require('../helpers/utils') | 15 | var requests = require('../helpers/requests') |
15 | var Videos = require('../models/videos') | 16 | var Videos = require('../models/videos') |
16 | 17 | ||
17 | var http = config.get('webserver.https') ? 'https' : 'http' | 18 | var http = config.get('webserver.https') ? 'https' : 'http' |
@@ -48,7 +49,7 @@ | |||
48 | var pods_score = {} | 49 | var pods_score = {} |
49 | 50 | ||
50 | logger.info('Make friends!') | 51 | logger.info('Make friends!') |
51 | fs.readFile(utils.getCertDir() + 'peertube.pub', 'utf8', function (err, cert) { | 52 | fs.readFile(peertubeCrypto.getCertDir() + 'peertube.pub', 'utf8', function (err, cert) { |
52 | if (err) { | 53 | if (err) { |
53 | logger.error('Cannot read public cert.', { error: err }) | 54 | logger.error('Cannot read public cert.', { error: err }) |
54 | return callback(err) | 55 | return callback(err) |
@@ -115,7 +116,7 @@ | |||
115 | videos: videos_list | 116 | videos: videos_list |
116 | } | 117 | } |
117 | 118 | ||
118 | utils.makeMultipleRetryRequest( | 119 | requests.makeMultipleRetryRequest( |
119 | { method: 'POST', path: '/api/' + constants.API_VERSION + '/pods/', data: data }, | 120 | { method: 'POST', path: '/api/' + constants.API_VERSION + '/pods/', data: data }, |
120 | 121 | ||
121 | pods_list, | 122 | pods_list, |
@@ -176,7 +177,7 @@ | |||
176 | } | 177 | } |
177 | 178 | ||
178 | // Announce we quit them | 179 | // Announce we quit them |
179 | utils.makeMultipleRetryRequest(request, pods, function () { | 180 | requests.makeMultipleRetryRequest(request, pods, function () { |
180 | Pods.removeAll(function (err) { | 181 | Pods.removeAll(function (err) { |
181 | poolRequests.activate() | 182 | poolRequests.activate() |
182 | 183 | ||