diff options
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 | } |