aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/friends.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/lib/friends.js b/server/lib/friends.js
index 3ed29f651..ad9e4fdae 100644
--- a/server/lib/friends.js
+++ b/server/lib/friends.js
@@ -66,10 +66,12 @@ function makeFriends (hosts, callback) {
66function quitFriends (callback) { 66function quitFriends (callback) {
67 // Stop pool requests 67 // Stop pool requests
68 db.Request.deactivate() 68 db.Request.deactivate()
69 // Flush pool requests
70 db.Request.flush()
71 69
72 waterfall([ 70 waterfall([
71 function flushRequests (callbackAsync) {
72 db.Request.flush(callbackAsync)
73 },
74
73 function getPodsList (callbackAsync) { 75 function getPodsList (callbackAsync) {
74 return db.Pod.list(callbackAsync) 76 return db.Pod.list(callbackAsync)
75 }, 77 },
@@ -118,7 +120,7 @@ function removeVideoToFriends (videoParams) {
118} 120}
119 121
120function sendOwnedVideosToPod (podId) { 122function sendOwnedVideosToPod (podId) {
121 db.Video.listOwnedAndPopulateAuthor(function (err, videosList) { 123 db.Video.listOwnedAndPopulateAuthorAndTags(function (err, videosList) {
122 if (err) { 124 if (err) {
123 logger.error('Cannot get the list of videos we own.') 125 logger.error('Cannot get the list of videos we own.')
124 return 126 return
@@ -226,7 +228,7 @@ function makeRequestsToWinningPods (cert, podsList, callback) {
226 } 228 }
227 229
228 // Add our videos to the request scheduler 230 // Add our videos to the request scheduler
229 sendOwnedVideosToPod(podCreated._id) 231 sendOwnedVideosToPod(podCreated.id)
230 232
231 return callbackEach() 233 return callbackEach()
232 }) 234 })