fix: start scheduled jobs on initial admin account setup

issue #170
This commit is contained in:
notfakie
2022-07-11 17:29:17 +12:00
parent a5cc36c88f
commit b08025195e
2 changed files with 15 additions and 2 deletions

View File

@@ -87,8 +87,18 @@ app
new WebPushAgent(),
]);
// Start Jobs
startJobs();
const userRepository = getRepository(User);
const totalUsers = await userRepository.count();
if (totalUsers > 0) {
startJobs();
} else {
logger.info(
`Skipping starting the scheduled jobs as we have no Plex/Jellyfin/Emby servers setup yet`,
{
label: 'Server',
}
);
}
const server = express();
if (settings.main.trustProxy) {