diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-14 17:31:26 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:51 +0100 |
commit | 350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad (patch) | |
tree | f4191f3c04a5230fcf8ca3d6ca3248643fc4151d /server/initializers/checker.ts | |
parent | e34c85e527100c0b5c44567bd951e95be41b8d7e (diff) | |
download | PeerTube-350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad.tar.gz PeerTube-350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad.tar.zst PeerTube-350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad.zip |
Follow works
Diffstat (limited to 'server/initializers/checker.ts')
-rw-r--r-- | server/initializers/checker.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/server/initializers/checker.ts b/server/initializers/checker.ts index b69188f7e..317d59423 100644 --- a/server/initializers/checker.ts +++ b/server/initializers/checker.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import * as config from 'config' | 1 | import * as config from 'config' |
2 | |||
3 | import { promisify0 } from '../helpers/core-utils' | 2 | import { promisify0 } from '../helpers/core-utils' |
4 | import { OAuthClientModel } from '../models/oauth/oauth-client-interface' | ||
5 | import { UserModel } from '../models/account/user-interface' | 3 | import { UserModel } from '../models/account/user-interface' |
4 | import { ApplicationModel } from '../models/application/application-interface' | ||
5 | import { OAuthClientModel } from '../models/oauth/oauth-client-interface' | ||
6 | 6 | ||
7 | // Some checks on configuration files | 7 | // Some checks on configuration files |
8 | function checkConfig () { | 8 | function checkConfig () { |
@@ -70,6 +70,13 @@ async function usersExist (User: UserModel) { | |||
70 | return totalUsers !== 0 | 70 | return totalUsers !== 0 |
71 | } | 71 | } |
72 | 72 | ||
73 | // We get db by param to not import it in this file (import orders) | ||
74 | async function applicationExist (Application: ApplicationModel) { | ||
75 | const totalApplication = await Application.countTotal() | ||
76 | |||
77 | return totalApplication !== 0 | ||
78 | } | ||
79 | |||
73 | // --------------------------------------------------------------------------- | 80 | // --------------------------------------------------------------------------- |
74 | 81 | ||
75 | export { | 82 | export { |
@@ -77,5 +84,6 @@ export { | |||
77 | checkFFmpeg, | 84 | checkFFmpeg, |
78 | checkMissedConfig, | 85 | checkMissedConfig, |
79 | clientsExist, | 86 | clientsExist, |
80 | usersExist | 87 | usersExist, |
88 | applicationExist | ||
81 | } | 89 | } |