Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Use async series in installer for better readability

Chocobozzzcefc718dd6b6
diff --git a/server/initializers/installer.js b/server/initializers/installer.js
index c2f5e47bc8..53b07903c3 100644
--- a/server/initializers/installer.js
+++ b/server/initializers/installer.js
@@ -16,21 +16,23 @@ const installer = {
}
function installApplication (callback) {
- // Creates directories
- createDirectoriesIfNotExist(function (err) {
- if (err) return callback(err)
-
- // ----------- Create the certificates if they don't already exist -----------
- peertubeCrypto.createCertsIfNotExist(function (err) {
- if (err) return callback(err)
-
- createOAuthClientIfNotExist(function (err) {
- if (err) return callback(err)
-
- createOAuthUserIfNotExist(callback)
- })
- })
- })
+ async.series([
+ function createDirectories (callbackAsync) {
+ createDirectoriesIfNotExist(callbackAsync)
+ },
+
+ function createCertificates (callbackAsync) {
+ peertubeCrypto.createCertsIfNotExist(callbackAsync)
+ },
+
+ function createOAuthClient (callbackAsync) {
+ createOAuthClientIfNotExist(callbackAsync)
+ },
+
+ function createOAuthUser (callbackAsync) {
+ createOAuthUserIfNotExist(callbackAsync)
+ }
+ ], callback)
}
// ---------------------------------------------------------------------------