Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/services/platform.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
7 changes: 3 additions & 4 deletions src/services/temporal/website.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,16 @@ class TemporalWebsiteService extends TemporalCoreService {
public async deleteSchedule(scheduleId: string): Promise<void> {
const client: Client = await this.getClient();
const handle = client.schedule.getHandle(scheduleId);

await handle.delete();
}

public async terminateWorkflow(workflowId: string): Promise<void> {
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');
}
}
}
Expand Down