Skip to content

Commit 9d6b2ce

Browse files
committed
set new worker group as default if none yet
1 parent 356d810 commit 9d6b2ce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/webapp/app/v3/services/worker/workerGroupService.server.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ export class WorkerGroupService extends WithRunEngine {
4747
},
4848
});
4949

50-
if (managedCount === 1) {
50+
const getFlag = makeFlags(this._prisma);
51+
const defaultWorkerInstanceGroupId = await getFlag({
52+
key: "defaultWorkerInstanceGroupId",
53+
});
54+
55+
// If there's no global default yet we should set it to the new worker group
56+
if (!defaultWorkerInstanceGroupId) {
5157
const setFlag = makeSetFlags(this._prisma);
5258
await setFlag({
5359
key: "defaultWorkerInstanceGroupId",

0 commit comments

Comments
 (0)