]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/installer.ts
Fix database benchmark in prod mode
[github/Chocobozzz/PeerTube.git] / server / initializers / installer.ts
index 26e92be0b8d40129f5160acd70c5193e453f37a8..10b74b85fd50cb8b2334f52716d4e4fc2522b21d 100644 (file)
@@ -38,12 +38,12 @@ function removeCacheDirectories () {
 }
 
 function createDirectoriesIfNotExist () {
-  const storages = CONFIG.STORAGE
+  const storage = CONFIG.STORAGE
   const cacheDirectories = CACHE.DIRECTORIES
 
   const tasks = []
-  Object.keys(storages).forEach(key => {
-    const dir = storages[key]
+  Object.keys(storage).forEach(key => {
+    const dir = storage[key]
     tasks.push(mkdirpPromise(dir))
   })
 
@@ -57,7 +57,7 @@ function createDirectoriesIfNotExist () {
 }
 
 function createOAuthClientIfNotExist () {
-  return clientsExist().then(exist => {
+  return clientsExist(db.OAuthClient).then(exist => {
     // Nothing to do, clients already exist
     if (exist === true) return undefined
 
@@ -82,7 +82,7 @@ function createOAuthClientIfNotExist () {
 }
 
 function createOAuthAdminIfNotExist () {
-  return usersExist().then(exist => {
+  return usersExist(db.User).then(exist => {
     // Nothing to do, users already exist
     if (exist === true) return undefined
 
@@ -112,7 +112,8 @@ function createOAuthAdminIfNotExist () {
       username,
       email,
       password,
-      role
+      role,
+      videoQuota: -1
     }
 
     return db.User.create(userData, createOptions).then(createdUser => {