Skip to content

Commit e0196ba

Browse files
Merge pull request #462 from TogetherCrew/handle-website-workflows
fix: check if workflow is stop already
2 parents 12f9149 + e879fee commit e0196ba

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/services/temporal/website.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ class TemporalWebsiteService extends TemporalCoreService {
6464
console.log(workflowId);
6565
const client: Client = await this.getClient();
6666
const handle = client.workflow.getHandle(workflowId);
67-
console.log(handle);
68-
await handle.terminate();
67+
const description = await handle.describe();
68+
console.log(description);
69+
if (description.status.name === 'TERMINATED') {
70+
await handle.terminate();
71+
}
6972
}
7073
}
7174

0 commit comments

Comments
 (0)