fix(apps): update all apps in a stuck state to "stopped" upon restart
This commit is contained in:
parent
5397a551de
commit
48cee9d23d
1 changed files with 3 additions and 0 deletions
|
@ -37,6 +37,9 @@ export class AppServiceClass {
|
|||
public async startAllApps() {
|
||||
const apps = await this.prisma.app.findMany({ where: { status: 'running' }, orderBy: { id: 'asc' } });
|
||||
|
||||
// Update all apps with status different than running or stopped to stopped
|
||||
await this.prisma.app.updateMany({ where: { status: { notIn: ['running', 'stopped', 'missing'] } }, data: { status: 'stopped' } });
|
||||
|
||||
await Promise.all(
|
||||
apps.map(async (app) => {
|
||||
// Regenerate env file
|
||||
|
|
Loading…
Add table
Reference in a new issue