Skip to content

Commit 6b9289d

Browse files
author
deepshekhardas
committed
fix: explicitly set machineConfig to null when task machine is removed (#2796)
When a user removes the machine configuration from a task and redeploys, task.machine becomes undefined. Prisma's create() silently skips undefined fields for Json columns rather than setting them to NULL. This change uses the nullish coalescing operator to explicitly pass null, ensuring the machineConfig column is cleared in the database.
1 parent 1d744fa commit 6b9289d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/webapp/app/v3/services/createBackgroundWorker.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ async function createWorkerTask(
276276
exportName: task.exportName,
277277
retryConfig: task.retry,
278278
queueConfig: task.queue,
279-
machineConfig: task.machine,
279+
machineConfig: task.machine ?? null,
280280
triggerSource: task.triggerSource === "schedule" ? "SCHEDULED" : "STANDARD",
281281
fileId: tasksToBackgroundFiles?.get(task.id) ?? null,
282282
maxDurationInSeconds: task.maxDuration ? clampMaxDuration(task.maxDuration) : null,

0 commit comments

Comments
 (0)