]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Server: udpate async to 2.0.0
authorChocobozzz <florian.bigard@gmail.com>
Mon, 18 Jul 2016 15:17:52 +0000 (17:17 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Mon, 18 Jul 2016 15:17:52 +0000 (17:17 +0200)
15 files changed:
package.json
server/controllers/api/v1/pods.js
server/controllers/api/v1/remote.js
server/controllers/api/v1/videos.js
server/initializers/installer.js
server/lib/friends.js
server/models/request.js
server/models/video.js
server/tests/api/checkParams.js
server/tests/api/friendsAdvanced.js
server/tests/api/friendsBasic.js
server/tests/api/multiplePods.js
server/tests/api/singlePod.js
server/tests/api/users.js
server/tests/real-world/real-world.js

index d5f758f4d7fda7221953433e85a291554de284bd..9a0d4ecaaf3806b3a2c1b2a56e160903d70ee1bd 100644 (file)
@@ -34,7 +34,7 @@
     "postinstall": "cd client && npm install"
   },
   "dependencies": {
-    "async": "^1.2.1",
+    "async": "^2.0.0",
     "bittorrent-tracker": "^8.0.0",
     "body-parser": "^1.12.4",
     "concurrently": "^2.0.0",
@@ -53,7 +53,6 @@
     "morgan": "^1.5.3",
     "multer": "^1.1.0",
     "node-ipc": "^8.0.0",
-    "node-sass": "^3.4.2",
     "openssl-wrapper": "^0.3.4",
     "password-generator": "^2.0.2",
     "request": "^2.57.0",
index 4413fbc1e49aaa732a8720b2e816c388584a3660..2bc761fef4348c93673c4b4b903e3564ca9c7779 100644 (file)
@@ -1,8 +1,9 @@
 'use strict'
 
-const async = require('async')
+const each = require('async/each')
 const express = require('express')
 const mongoose = require('mongoose')
+const waterfall = require('async/waterfall')
 
 const logger = require('../../../helpers/logger')
 const friends = require('../../../lib/friends')
@@ -31,7 +32,7 @@ module.exports = router
 function addPods (req, res, next) {
   const informations = req.body
 
-  async.waterfall([
+  waterfall([
     function addPod (callback) {
       const pod = new Pod(informations)
       pod.save(function (err, podCreated) {
@@ -82,7 +83,7 @@ function makeFriends (req, res, next) {
 function removePods (req, res, next) {
   const url = req.body.signature.url
 
-  async.waterfall([
+  waterfall([
     function loadPod (callback) {
       Pod.loadByUrl(url, callback)
     },
@@ -106,7 +107,7 @@ function removePods (req, res, next) {
     },
 
     function removeTheRemoteVideos (videosList, callback) {
-      async.each(videosList, function (video, callbackEach) {
+      each(videosList, function (video, callbackEach) {
         video.remove(callbackEach)
       }, callback)
     }
index 9c2ca86e0bc3cfb7f496c4348f52965e62a104ca..f452986b8e951aa0498fb5b35b7a4ffca0f6dde3 100644 (file)
@@ -1,6 +1,7 @@
 'use strict'
 
-const async = require('async')
+const each = require('async/each')
+const eachSeries = require('async/eachSeries')
 const express = require('express')
 const mongoose = require('mongoose')
 
@@ -32,7 +33,7 @@ function remoteVideos (req, res, next) {
 
   // We need to process in the same order to keep consistency
   // TODO: optimization
-  async.eachSeries(requests, function (request, callbackEach) {
+  eachSeries(requests, function (request, callbackEach) {
     const videoData = request.data
 
     if (request.type === 'add') {
@@ -72,7 +73,7 @@ function removeRemoteVideo (videoToRemoveData, fromUrl, callback) {
       logger.error('No remote video was found for this pod.', { magnetUri: videoToRemoveData.magnetUri, podUrl: fromUrl })
     }
 
-    async.each(videosList, function (video, callbackEach) {
+    each(videosList, function (video, callbackEach) {
       logger.debug('Removing remote video %s.', video.magnetUri)
 
       video.remove(callbackEach)
index a37e9278e30576e78a4b19e7865cb50e5b12218c..1f939b077f1f80711c3560142a9c7f5708360319 100644 (file)
@@ -1,10 +1,10 @@
 'use strict'
 
-const async = require('async')
 const config = require('config')
 const express = require('express')
 const mongoose = require('mongoose')
 const multer = require('multer')
+const waterfall = require('async/waterfall')
 
 const logger = require('../../../helpers/logger')
 const friends = require('../../../lib/friends')
@@ -85,7 +85,7 @@ function addVideo (req, res, next) {
   const videoFile = req.files.videofile[0]
   const videoInfos = req.body
 
-  async.waterfall([
+  waterfall([
 
     function insertIntoDB (callback) {
       const videoData = {
@@ -152,7 +152,7 @@ function listVideos (req, res, next) {
 function removeVideo (req, res, next) {
   const videoId = req.params.id
 
-  async.waterfall([
+  waterfall([
     function getVideo (callback) {
       Video.load(videoId, callback)
     },
index 014efbcb7b7daf14b6420c63d18250947d557d43..490084104d142612b247a08baa6781b2860c7ff6 100644 (file)
@@ -1,11 +1,12 @@
 'use strict'
 
-const async = require('async')
 const config = require('config')
+const each = require('async/each')
 const mkdirp = require('mkdirp')
 const mongoose = require('mongoose')
 const passwordGenerator = require('password-generator')
 const path = require('path')
+const series = require('async/series')
 
 const checker = require('./checker')
 const logger = require('../helpers/logger')
@@ -19,7 +20,7 @@ const installer = {
 }
 
 function installApplication (callback) {
-  async.series([
+  series([
     function createDirectories (callbackAsync) {
       createDirectoriesIfNotExist(callbackAsync)
     },
@@ -47,7 +48,7 @@ module.exports = installer
 function createDirectoriesIfNotExist (callback) {
   const storages = config.get('storage')
 
-  async.each(Object.keys(storages), function (key, callbackEach) {
+  each(Object.keys(storages), function (key, callbackEach) {
     const dir = storages[key]
     mkdirp(path.join(__dirname, '..', '..', dir), callbackEach)
   }, callback)
index a85f4e19acca4f655686704255774af5658a6704..6e1516b94a14ae09d07ea387f53e9264c6e82263 100644 (file)
@@ -1,10 +1,13 @@
 'use strict'
 
-const async = require('async')
 const config = require('config')
+const each = require('async/each')
+const eachLimit = require('async/eachLimit')
+const eachSeries = require('async/eachSeries')
 const fs = require('fs')
 const mongoose = require('mongoose')
 const request = require('request')
+const waterfall = require('async/waterfall')
 
 const constants = require('../initializers/constants')
 const logger = require('../helpers/logger')
@@ -57,7 +60,7 @@ function makeFriends (callback) {
 
     const urls = config.get('network.friends')
 
-    async.eachSeries(urls, function (url, callbackEach) {
+    eachSeries(urls, function (url, callbackEach) {
       computeForeignPodsList(url, podsScore, callbackEach)
     }, function (err) {
       if (err) return callback(err)
@@ -77,7 +80,7 @@ function quitFriends (callback) {
   // Flush pool requests
   Request.flush()
 
-  async.waterfall([
+  waterfall([
     function getPodsList (callbackAsync) {
       return Pod.list(callbackAsync)
     },
@@ -92,7 +95,7 @@ function quitFriends (callback) {
       // Announce we quit them
       // We don't care if the request fails
       // The other pod will exclude us automatically after a while
-      async.eachLimit(pods, constants.REQUESTS_IN_PARALLEL, function (pod, callbackEach) {
+      eachLimit(pods, constants.REQUESTS_IN_PARALLEL, function (pod, callbackEach) {
         requestParams.toPod = pod
         requests.makeSecureRequest(requestParams, callbackEach)
       }, function (err) {
@@ -118,7 +121,7 @@ function quitFriends (callback) {
     },
 
     function removeTheRemoteVideos (videosList, callbackAsync) {
-      async.each(videosList, function (video, callbackEach) {
+      each(videosList, function (video, callbackEach) {
         video.remove(callbackEach)
       }, callbackAsync)
     }
@@ -212,7 +215,7 @@ function makeRequestsToWinningPods (cert, podsList, callback) {
   // Flush pool requests
   Request.forceSend()
 
-  async.eachLimit(podsList, constants.REQUESTS_IN_PARALLEL, function (pod, callbackEach) {
+  eachLimit(podsList, constants.REQUESTS_IN_PARALLEL, function (pod, callbackEach) {
     const params = {
       url: pod.url + '/api/' + constants.API_VERSION + '/pods/',
       method: 'POST',
index 248ab330306735cfd693da8bc32139bb617b8596..4d521919a11185fd4cb3c522bd1f99be1e6061f3 100644 (file)
@@ -1,8 +1,10 @@
 'use strict'
 
-const async = require('async')
+const each = require('async/each')
+const eachLimit = require('async/eachLimit')
 const map = require('lodash/map')
 const mongoose = require('mongoose')
+const waterfall = require('async/waterfall')
 
 const constants = require('../initializers/constants')
 const logger = require('../helpers/logger')
@@ -136,7 +138,7 @@ function makeRequests () {
     const goodPods = []
     const badPods = []
 
-    async.eachLimit(Object.keys(requestsToMake), constants.REQUESTS_IN_PARALLEL, function (toPodId, callbackEach) {
+    eachLimit(Object.keys(requestsToMake), constants.REQUESTS_IN_PARALLEL, function (toPodId, callbackEach) {
       const requestToMake = requestsToMake[toPodId]
 
       // FIXME: mongodb request inside a loop :/
@@ -183,7 +185,7 @@ function makeRequests () {
 
 // Remove pods with a score of 0 (too many requests where they were unreachable)
 function removeBadPods () {
-  async.waterfall([
+  waterfall([
     function findBadPods (callback) {
       Pod.listBadPods(function (err, pods) {
         if (err) {
@@ -217,7 +219,7 @@ function removeBadPods () {
         return callback(null)
       }
 
-      async.each(videosList, function (video, callbackEach) {
+      each(videosList, function (video, callbackEach) {
         video.remove(callbackEach)
       }, function (err) {
         if (err) {
@@ -237,7 +239,7 @@ function removeBadPods () {
         return callback(null)
       }
 
-      async.each(pods, function (pod, callbackEach) {
+      each(pods, function (pod, callbackEach) {
         pod.remove(callbackEach)
       }, function (err) {
         if (err) return callback(err)
index 8054caa773fc667b298dcdc06e0b19fb25e19bdd..98f43a06de86ed03baec25b49019a61fe0b474a5 100644 (file)
@@ -1,9 +1,10 @@
 'use strict'
 
-const async = require('async')
 const config = require('config')
+const each = require('async/each')
 const ffmpeg = require('fluent-ffmpeg')
 const fs = require('fs')
+const parallel = require('async/parallel')
 const pathUtils = require('path')
 const mongoose = require('mongoose')
 
@@ -90,7 +91,7 @@ VideoSchema.pre('remove', function (next) {
     )
   }
 
-  async.parallel(tasks, next)
+  parallel(tasks, next)
 })
 
 VideoSchema.pre('save', function (next) {
@@ -110,7 +111,7 @@ VideoSchema.pre('save', function (next) {
       }
     )
 
-    async.parallel(tasks, function (err, results) {
+    parallel(tasks, function (err, results) {
       if (err) return next(err)
 
       video.magnetUri = results[0].magnetURI
@@ -234,7 +235,7 @@ function seedAllExisting (callback) {
   listOwned.call(this, function (err, videos) {
     if (err) return callback(err)
 
-    async.each(videos, function (video, callbackEach) {
+    each(videos, function (video, callbackEach) {
       const videoPath = pathUtils.join(uploadsDir, video.filename)
       seed(videoPath, callbackEach)
     }, callback)
@@ -246,7 +247,7 @@ function seedAllExisting (callback) {
 function findWithCount (query, start, count, sort, callback) {
   const self = this
 
-  async.parallel([
+  parallel([
     function (asyncCallback) {
       self.find(query).skip(start).limit(count).sort(sort).exec(asyncCallback)
     },
index 7f22a37ccbc0eb275bb665b9ac03cbb779d2a511..c1ba9c2c09d899de0c71297f7a1bdfc268905022 100644 (file)
@@ -1,10 +1,10 @@
 'use strict'
 
-const async = require('async')
 const chai = require('chai')
 const expect = chai.expect
 const pathUtils = require('path')
 const request = require('supertest')
+const series = require('async/series')
 
 const utils = require('./utils')
 
@@ -57,7 +57,7 @@ describe('Test parameters validator', function () {
   before(function (done) {
     this.timeout(20000)
 
-    async.series([
+    series([
       function (next) {
         utils.flushTests(next)
       },
index b082270ff58615b7862cc87496b1c98a0938ad52..603fbc16bec368b4d94c30f8b8af24a8a8fe8414 100644 (file)
@@ -1,8 +1,9 @@
 'use strict'
 
-const async = require('async')
 const chai = require('chai')
+const each = require('async/each')
 const expect = chai.expect
+const series = require('async/series')
 
 const utils = require('./utils')
 
@@ -45,7 +46,7 @@ describe('Test advanced friends', function () {
     utils.flushAndRunMultipleServers(6, function (serversRun, urlsRun) {
       servers = serversRun
 
-      async.each(servers, function (server, callbackEach) {
+      each(servers, function (server, callbackEach) {
         utils.loginAndGetAccessToken(server, function (err, accessToken) {
           if (err) return callbackEach(err)
 
@@ -59,7 +60,7 @@ describe('Test advanced friends', function () {
   it('Should make friends with two pod each in a different group', function (done) {
     this.timeout(20000)
 
-    async.series([
+    series([
       // Pod 3 makes friend with the first one
       function (next) {
         makeFriends(3, next)
@@ -93,7 +94,7 @@ describe('Test advanced friends', function () {
   it('Should quit all friends', function (done) {
     this.timeout(10000)
 
-    async.series([
+    series([
       function (next) {
         quitFriends(1, next)
       },
@@ -103,7 +104,7 @@ describe('Test advanced friends', function () {
       function (err) {
         if (err) throw err
 
-        async.each([ 1, 2, 3, 4, 5, 6 ], function (i, callback) {
+        each([ 1, 2, 3, 4, 5, 6 ], function (i, callback) {
           getFriendsList(i, function (err, res) {
             if (err) throw err
 
@@ -119,7 +120,7 @@ describe('Test advanced friends', function () {
   it('Should make friends with the pods 1, 2, 3', function (done) {
     this.timeout(150000)
 
-    async.series([
+    series([
       // Pods 1, 2, 3 and 4 become friends
       function (next) {
         makeFriends(2, next)
@@ -132,7 +133,7 @@ describe('Test advanced friends', function () {
       },
       // Check the pods 1, 2, 3 and 4 are friends
       function (next) {
-        async.each([ 1, 2, 3, 4 ], function (i, callback) {
+        each([ 1, 2, 3, 4 ], function (i, callback) {
           getFriendsList(i, function (err, res) {
             if (err) throw err
 
@@ -211,7 +212,7 @@ describe('Test advanced friends', function () {
   it('Should pod 1 quit friends', function (done) {
     this.timeout(25000)
 
-    async.series([
+    series([
       // Upload a video on server 3 for aditionnal tests
       function (next) {
         uploadVideo(3, next)
index 5b738ad39a924dd8b5d089581c0ee05edbbd73e5..c74a7f2249154c47e5a142102a4f19176cb7166d 100644 (file)
@@ -1,8 +1,9 @@
 'use strict'
 
-const async = require('async')
 const chai = require('chai')
+const each = require('async/each')
 const expect = chai.expect
+const series = require('async/series')
 
 const utils = require('./utils')
 
@@ -45,7 +46,7 @@ describe('Test basic friends', function () {
     utils.flushAndRunMultipleServers(3, function (serversRun, urlsRun) {
       servers = serversRun
 
-      async.each(servers, function (server, callbackEach) {
+      each(servers, function (server, callbackEach) {
         utils.loginAndGetAccessToken(server, function (err, accessToken) {
           if (err) return callbackEach(err)
 
@@ -57,7 +58,7 @@ describe('Test basic friends', function () {
   })
 
   it('Should not have friends', function (done) {
-    async.each(servers, function (server, callback) {
+    each(servers, function (server, callback) {
       utils.getFriendsList(server.url, function (err, res) {
         if (err) throw err
 
@@ -72,7 +73,7 @@ describe('Test basic friends', function () {
   it('Should make friends', function (done) {
     this.timeout(10000)
 
-    async.series([
+    series([
       // The second pod make friend with the third
       function (next) {
         makeFriends(2, next)
@@ -119,7 +120,7 @@ describe('Test basic friends', function () {
     // Now each pod should be friend with the other ones
     function (err) {
       if (err) throw err
-      async.each(servers, function (server, callback) {
+      each(servers, function (server, callback) {
         testMadeFriends(servers, server, callback)
       }, done)
     })
@@ -131,7 +132,7 @@ describe('Test basic friends', function () {
   })
 
   it('Should quit friends of pod 2', function (done) {
-    async.series([
+    series([
       // Pod 1 quit friends
       function (next) {
         const server = servers[1]
@@ -151,7 +152,7 @@ describe('Test basic friends', function () {
       },
       // Other pods shouldn't have pod 1 too
       function (next) {
-        async.each([ servers[0].url, servers[2].url ], function (url, callback) {
+        each([ servers[0].url, servers[2].url ], function (url, callback) {
           utils.getFriendsList(url, function (err, res) {
             if (err) throw err
 
@@ -169,7 +170,7 @@ describe('Test basic friends', function () {
   it('Should allow pod 2 to make friend again', function (done) {
     const server = servers[1]
     utils.makeFriends(server.url, server.accessToken, function () {
-      async.each(servers, function (server, callback) {
+      each(servers, function (server, callback) {
         testMadeFriends(servers, server, callback)
       }, done)
     })
index 2a1bc64e601b2381f7c4492cdb9d59a1a516d6a9..ac140f6bb4aef7ffb013ad37dead888857c36c07 100644 (file)
@@ -1,9 +1,10 @@
 'use strict'
 
-const async = require('async')
 const chai = require('chai')
+const each = require('async/each')
 const expect = chai.expect
 const pathUtils = require('path')
+const series = require('async/series')
 
 const utils = require('./utils')
 const webtorrent = require(pathUtils.join(__dirname, '../../lib/webtorrent'))
@@ -16,7 +17,7 @@ describe('Test multiple pods', function () {
   before(function (done) {
     this.timeout(30000)
 
-    async.series([
+    series([
       // Run servers
       function (next) {
         utils.flushAndRunMultipleServers(3, function (serversRun) {
@@ -26,7 +27,7 @@ describe('Test multiple pods', function () {
       },
       // Get the access tokens
       function (next) {
-        async.each(servers, function (server, callbackEach) {
+        each(servers, function (server, callbackEach) {
           utils.loginAndGetAccessToken(server, function (err, accessToken) {
             if (err) return callbackEach(err)
 
@@ -56,7 +57,7 @@ describe('Test multiple pods', function () {
   })
 
   it('Should not have videos for all pods', function (done) {
-    async.each(servers, function (server, callback) {
+    each(servers, function (server, callback) {
       utils.getVideosList(server.url, function (err, res) {
         if (err) throw err
 
@@ -73,7 +74,7 @@ describe('Test multiple pods', function () {
     it('Should upload the video on pod 1 and propagate on each pod', function (done) {
       this.timeout(15000)
 
-      async.series([
+      series([
         function (next) {
           const name = 'my super name for pod 1'
           const description = 'my super description for pod 1'
@@ -88,7 +89,7 @@ describe('Test multiple pods', function () {
         function (err) {
           if (err) throw err
 
-          async.each(servers, function (server, callback) {
+          each(servers, function (server, callback) {
             let baseMagnet = null
 
             utils.getVideosList(server.url, function (err, res) {
@@ -135,7 +136,7 @@ describe('Test multiple pods', function () {
     it('Should upload the video on pod 2 and propagate on each pod', function (done) {
       this.timeout(15000)
 
-      async.series([
+      series([
         function (next) {
           const name = 'my super name for pod 2'
           const description = 'my super description for pod 2'
@@ -150,7 +151,7 @@ describe('Test multiple pods', function () {
         function (err) {
           if (err) throw err
 
-          async.each(servers, function (server, callback) {
+          each(servers, function (server, callback) {
             let baseMagnet = null
 
             utils.getVideosList(server.url, function (err, res) {
@@ -197,7 +198,7 @@ describe('Test multiple pods', function () {
     it('Should upload two videos on pod 3 and propagate on each pod', function (done) {
       this.timeout(30000)
 
-      async.series([
+      series([
         function (next) {
           const name = 'my super name for pod 3'
           const description = 'my super description for pod 3'
@@ -220,7 +221,7 @@ describe('Test multiple pods', function () {
 
           let baseMagnet = null
           // All pods should have this video
-          async.each(servers, function (server, callback) {
+          each(servers, function (server, callback) {
             utils.getVideosList(server.url, function (err, res) {
               if (err) throw err
 
@@ -372,7 +373,7 @@ describe('Test multiple pods', function () {
     it('Should remove the file 3 and 3-2 by asking pod 3', function (done) {
       this.timeout(15000)
 
-      async.series([
+      series([
         function (next) {
           utils.removeVideo(servers[2].url, servers[2].accessToken, toRemove[0], next)
         },
@@ -387,7 +388,7 @@ describe('Test multiple pods', function () {
     })
 
     it('Should have videos 1 and 3 on each pod', function (done) {
-      async.each(servers, function (server, callback) {
+      each(servers, function (server, callback) {
         utils.getVideosList(server.url, function (err, res) {
           if (err) throw err
 
index 465a86b136e7e9d719cee4b0679ce809918a9c37..6ed719f871528909ca47b0ca9042f85e5c7f1e3f 100644 (file)
@@ -1,11 +1,12 @@
 'use strict'
 
-const async = require('async')
 const chai = require('chai')
+const each = require('async/each')
 const expect = chai.expect
 const fs = require('fs')
 const keyBy = require('lodash/keyBy')
 const pathUtils = require('path')
+const series = require('async/series')
 
 const webtorrent = require(pathUtils.join(__dirname, '../../lib/webtorrent'))
 webtorrent.silent = true
@@ -20,7 +21,7 @@ describe('Test a single pod', function () {
   before(function (done) {
     this.timeout(20000)
 
-    async.series([
+    series([
       function (next) {
         utils.flushTests(next)
       },
@@ -280,7 +281,7 @@ describe('Test a single pod', function () {
       'video_short.mp4', 'video_short.ogv', 'video_short.webm',
       'video_short1.webm', 'video_short2.webm', 'video_short3.webm'
     ]
-    async.each(videos, function (video, callbackEach) {
+    each(videos, function (video, callbackEach) {
       const name = video + ' name'
       const description = video + ' description'
       const tags = [ 'tag1', 'tag2', 'tag3' ]
@@ -318,7 +319,7 @@ describe('Test a single pod', function () {
       // For the next test
       videosListBase = videos
 
-      async.each(videos, function (video, callbackEach) {
+      each(videos, function (video, callbackEach) {
         if (err) throw err
         const videoName = video.name.replace(' name', '')
 
index 7ab426d855c2f07093e927b0acc4fbec19d96f85..749aa8af8abffad589dc316c797614ece23bd203 100644 (file)
@@ -1,9 +1,9 @@
 'use strict'
 
-const async = require('async')
 const chai = require('chai')
 const expect = chai.expect
 const pathUtils = require('path')
+const series = require('async/series')
 
 const webtorrent = require(pathUtils.join(__dirname, '../../lib/webtorrent'))
 webtorrent.silent = true
@@ -18,7 +18,7 @@ describe('Test users', function () {
   before(function (done) {
     this.timeout(20000)
 
-    async.series([
+    series([
       function (next) {
         utils.flushTests(next)
       },
index bc6ea859bf19d243a14f28235f00f1eecd526a8e..b28796852911087a16c5c725df67e28511ca88c3 100644 (file)
@@ -1,8 +1,9 @@
 'use strict'
 
-const async = require('async')
-const program = require('commander')
+const each = require('each')
 const isEqual = require('lodash/isEqual')
+const program = require('commander')
+const series = require('async/series')
 
 process.env.NODE_ENV = 'test'
 const constants = require('../../initializers/constants')
@@ -93,7 +94,7 @@ function getRandomNumServer (servers) {
 function runServers (numberOfPods, callback) {
   let servers = null
 
-  async.series([
+  series([
     // Run servers
     function (next) {
       utils.flushAndRunMultipleServers(numberOfPods, function (serversRun) {
@@ -103,7 +104,7 @@ function runServers (numberOfPods, callback) {
     },
     // Get the access tokens
     function (next) {
-      async.each(servers, function (server, callbackEach) {
+      each(servers, function (server, callbackEach) {
         utils.loginAndGetAccessToken(server, function (err, accessToken) {
           if (err) return callbackEach(err)
 
@@ -184,7 +185,7 @@ function remove (servers, numServer, callback) {
 
 function checkIntegrity (servers, callback) {
   const videos = []
-  async.each(servers, function (server, callback) {
+  each(servers, function (server, callback) {
     utils.getAllVideosListBy(server.url, function (err, res) {
       if (err) throw err
       const serverVideos = res.body.data