File tree Expand file tree Collapse file tree
apps/webapp/app/v3/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,13 +67,20 @@ export class FailDeploymentService extends BaseService {
6767 return ;
6868 }
6969
70- const failedDeployment = {
71- ...deployment ,
72- status : "FAILED" as const ,
73- failedAt,
74- errorData : params . error ,
75- buildEnvVars : null ,
76- } ;
70+ // Re-read after the guarded write: the row can gain phase timestamps
71+ // between the initial read and the update, and callers expect the
72+ // post-update row.
73+ const failedDeployment = await this . _prisma . workerDeployment . findFirst ( {
74+ where : { id : deployment . id } ,
75+ } ) ;
76+
77+ if ( ! failedDeployment ) {
78+ logger . error ( "Worker deployment disappeared after fail transition" , {
79+ id : deployment . id ,
80+ friendlyId,
81+ } ) ;
82+ return ;
83+ }
7784
7885 recordDeploymentLifecycle ( {
7986 status : "FAILED" ,
You can’t perform that action at this time.
0 commit comments