diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-10-21 11:20:45 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-10-21 11:20:45 +0200 |
commit | 80a6c9e76fda57f01e37fe4620771ae70738a211 (patch) | |
tree | 7381a94285c11d954efca2be8103c8b86df3e832 /server/lib | |
parent | 792b893ed414301c060391ed8a00368d68688236 (diff) | |
download | PeerTube-80a6c9e76fda57f01e37fe4620771ae70738a211.tar.gz PeerTube-80a6c9e76fda57f01e37fe4620771ae70738a211.tar.zst PeerTube-80a6c9e76fda57f01e37fe4620771ae70738a211.zip |
Server: pod removing refractoring
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/friends.js | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/server/lib/friends.js b/server/lib/friends.js index 556d2e773..55cecc53e 100644 --- a/server/lib/friends.js +++ b/server/lib/friends.js | |||
@@ -97,25 +97,13 @@ function quitFriends (callback) { | |||
97 | // Don't stop the process | 97 | // Don't stop the process |
98 | } | 98 | } |
99 | 99 | ||
100 | return callbackAsync() | 100 | return callbackAsync(null, pods) |
101 | }) | 101 | }) |
102 | }, | 102 | }, |
103 | 103 | ||
104 | function removePodsFromDB (callbackAsync) { | 104 | function removePodsFromDB (pods, callbackAsync) { |
105 | Pod.removeAll(function (err) { | 105 | each(pods, function (pod, callbackEach) { |
106 | return callbackAsync(err) | 106 | pod.remove(callbackEach) |
107 | }) | ||
108 | }, | ||
109 | |||
110 | function listRemoteVideos (callbackAsync) { | ||
111 | logger.info('Broke friends, so sad :(') | ||
112 | |||
113 | Video.listRemotes(callbackAsync) | ||
114 | }, | ||
115 | |||
116 | function removeTheRemoteVideos (videosList, callbackAsync) { | ||
117 | each(videosList, function (video, callbackEach) { | ||
118 | video.remove(callbackEach) | ||
119 | }, callbackAsync) | 107 | }, callbackAsync) |
120 | } | 108 | } |
121 | ], function (err) { | 109 | ], function (err) { |