Skip to content

Commit

Permalink
Try to get instance from external source if not exists on Hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
patuwwy committed Jan 23, 2024
1 parent aa2e5d7 commit cbc770c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/host/src/lib/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,26 @@ export class Host implements IComponent {
}

/**
* Check for Sequence.
* Pass information about connected instance to monitoring and platform services.
*
* @param {Instance} instance Instance data.
*/
async handleDispatcherEstablishedEvent(instance: Instance) {
const seq = this.sequenceStore.getById(instance.sequence.id);

this.logger.info("Checking Sequence...");

if (!seq) {
this.logger.info("Sequence not found. Checking Store...");

try {
await this.getExternalSequence(instance.sequence.id);
} catch (e) {
this.logger.warn("Sequence not found in store. Instance has no Sequence.");
}
}

this.auditor.auditInstance(instance.id, InstanceMessageCode.INSTANCE_CONNECTED);

await this.cpmConnector?.sendInstanceInfo({
Expand Down

0 comments on commit cbc770c

Please sign in to comment.