Skip to content

Commit ba9d163

Browse files
committed
fix: fix workflow id
1 parent 39dd122 commit ba9d163

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/services/platform.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ const handleWebsiteResourceChanges = async (
374374
if (oldResources === newResources) return;
375375

376376
if (platform.metadata.scheduleId) {
377-
// await websiteService.coreService.deleteWebsiteSchedule(platform.metadata.scheduleId);
377+
await websiteService.coreService.deleteWebsiteSchedule(platform.metadata.scheduleId);
378378
await websiteService.coreService.terminateWebsiteWorkflow(platform.community.toString());
379379
updateBody.metadata.scheduleId = null;
380380
}

src/services/temporal/website.service.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,16 @@ class TemporalWebsiteService extends TemporalCoreService {
5757
public async deleteSchedule(scheduleId: string): Promise<void> {
5858
const client: Client = await this.getClient();
5959
const handle = client.schedule.getHandle(scheduleId);
60+
6061
await handle.delete();
6162
}
6263

6364
public async terminateWorkflow(workflowId: string): Promise<void> {
64-
console.log(workflowId);
6565
const client: Client = await this.getClient();
6666
const handle = client.workflow.getHandle(workflowId);
6767
const description = await handle.describe();
68-
console.log(description);
69-
if (description.status.name === 'TERMINATED') {
70-
await handle.terminate();
68+
if (description.status.name !== 'TERMINATED' && description.status.name !== 'COMPLETED') {
69+
await handle.terminate('Terminated due to schedule deletion');
7170
}
7271
}
7372
}

0 commit comments

Comments
 (0)