]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Update standard -> 10
authorChocobozzz <florian.bigard@gmail.com>
Sun, 16 Apr 2017 12:25:37 +0000 (14:25 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Sun, 16 Apr 2017 12:25:37 +0000 (14:25 +0200)
client/config/webpack.common.js
client/package.json
package.json
server/helpers/peertube-crypto.js
server/lib/base-request-scheduler.js
server/tests/real-world/real-world.js

index 86cbf84d7852da230ccbb095c19124370d8fa164..35ea8ed284f04d88eda53a31109601f5b9d63997 100644 (file)
@@ -6,7 +6,6 @@ const helpers = require('./helpers')
 
 const AssetsPlugin = require('assets-webpack-plugin')
 const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
-const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin')
 const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin')
 const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin')
 const CopyWebpackPlugin = require('copy-webpack-plugin')
index 00eb0e272fef4409022c534a82f9ef8132b1e8a1..3e68007de579697aae5a1e9431c46b8f5d8cd72e 100644 (file)
@@ -90,7 +90,7 @@
   "devDependencies": {
     "add-asset-html-webpack-plugin": "^1.0.2",
     "codelyzer": "^2.0.0",
-    "standard": "^9.0.0",
+    "standard": "^10.0.0",
     "webpack-bundle-analyzer": "^2.2.1",
     "webpack-dll-bundles-plugin": "^1.0.0-beta.5"
   }
index c4c56ebddcec5ee286576502f1c844d3c44750a0..281d169c67555586cf58da809551dea7a9458b84 100644 (file)
@@ -64,7 +64,7 @@
     "password-generator": "^2.0.2",
     "pg": "^6.1.0",
     "pg-hstore": "^2.3.2",
-    "request": "^2.57.0",
+    "request": "^2.81.0",
     "request-replay": "^1.0.2",
     "rimraf": "^2.5.4",
     "safe-buffer": "^5.0.1",
@@ -77,7 +77,7 @@
     "chai": "^3.3.0",
     "commander": "^2.9.0",
     "mocha": "^3.0.1",
-    "standard": "^9.0.0",
+    "standard": "^10.0.0",
     "supertest": "^3.0.0",
     "webtorrent": "^0.98.0"
   },
index ef6808d5ce1edf4dc54e89535babebe622dda8a2..55ae6fab3274a62e311b142944fe773d902ae5b7 100644 (file)
@@ -74,7 +74,9 @@ function comparePassword (plainPassword, hashPassword, callback) {
 }
 
 function createCertsIfNotExist (callback) {
-  certsExist(function (exist) {
+  certsExist(function (err, exist) {
+    if (err) return callback(err)
+
     if (exist === true) {
       return callback(null)
     }
@@ -113,13 +115,17 @@ module.exports = peertubeCrypto
 
 function certsExist (callback) {
   const certPath = pathUtils.join(constants.CONFIG.STORAGE.CERT_DIR, constants.PRIVATE_CERT_NAME)
-  fs.exists(certPath, function (exists) {
-    return callback(exists)
+  fs.access(certPath, function (err) {
+    // If there is an error the certificates do not exist
+    const exists = !err
+    return callback(null, exists)
   })
 }
 
 function createCerts (callback) {
-  certsExist(function (exist) {
+  certsExist(function (err, exist) {
+    if (err) return callback(err)
+
     if (exist === true) {
       const string = 'Certs already exist.'
       logger.warning(string)
index 4709c7960fee4c97b05c0e377b1ee11e81b3be06..7378971c8192e6315ed2f22118fda5be33c2648c 100644 (file)
@@ -66,10 +66,10 @@ module.exports = class BaseRequestScheduler {
         err = err ? err.message : 'Status code not 20x : ' + res.statusCode
         logger.error('Error sending secure request to %s pod.', toPod.host, { error: err })
 
-        return callback(false)
+        return callback(err)
       }
 
-      return callback(true)
+      return callback(null)
     })
   }
 
@@ -99,8 +99,8 @@ module.exports = class BaseRequestScheduler {
         const requestToMake = requestsToMakeGrouped[hashKey]
         const toPod = requestToMake.toPod
 
-        this.makeRequest(toPod, requestToMake.endpoint, requestToMake.datas, (success) => {
-          if (success === false) {
+        this.makeRequest(toPod, requestToMake.endpoint, requestToMake.datas, (err) => {
+          if (err) {
             badPods.push(requestToMake.toPod.id)
             return callbackEach()
           }
index 21f0732d0bf071ceae370fdd9e3ca618594dfeca..3ac13f053f3ddb4f90ce7b1e2880aa86fa2cf9b6 100644 (file)
@@ -102,7 +102,9 @@ runServers(numberOfPods, function (err, servers) {
     checking = true
 
     const waitingInterval = setInterval(function () {
-      isThereAwaitingRequests(servers, function (res) {
+      isThereAwaitingRequests(servers, function (err, res) {
+        if (err) throw err
+
         if (res === true) {
           console.log('A server has awaiting requests, waiting...')
           return
@@ -360,6 +362,6 @@ function isThereAwaitingRequests (servers, callback) {
   }, function (err) {
     if (err) throw err
 
-    return callback(noRequests === false)
+    return callback(null, noRequests === false)
   })
 }