diff --git a/src/services/platform.service.ts b/src/services/platform.service.ts index beba37a..a96988f 100644 --- a/src/services/platform.service.ts +++ b/src/services/platform.service.ts @@ -374,7 +374,7 @@ const handleWebsiteResourceChanges = async ( if (oldResources === newResources) return; if (platform.metadata.scheduleId) { - // await websiteService.coreService.deleteWebsiteSchedule(platform.metadata.scheduleId); + await websiteService.coreService.deleteWebsiteSchedule(platform.metadata.scheduleId); await websiteService.coreService.terminateWebsiteWorkflow(platform.community.toString()); updateBody.metadata.scheduleId = null; } diff --git a/src/services/temporal/website.service.ts b/src/services/temporal/website.service.ts index 4555f0a..15b6fe6 100644 --- a/src/services/temporal/website.service.ts +++ b/src/services/temporal/website.service.ts @@ -57,17 +57,16 @@ class TemporalWebsiteService extends TemporalCoreService { public async deleteSchedule(scheduleId: string): Promise { const client: Client = await this.getClient(); const handle = client.schedule.getHandle(scheduleId); + await handle.delete(); } public async terminateWorkflow(workflowId: string): Promise { - console.log(workflowId); const client: Client = await this.getClient(); const handle = client.workflow.getHandle(workflowId); const description = await handle.describe(); - console.log(description); - if (description.status.name === 'TERMINATED') { - await handle.terminate(); + if (description.status.name !== 'TERMINATED' && description.status.name !== 'COMPLETED') { + await handle.terminate('Terminated due to schedule deletion'); } } }