Skip to content

Commit e45ebcb

Browse files
authored
chore: blabsy group synchronization (#332)
1 parent 16075c9 commit e45ebcb

File tree

1 file changed

+15
-0
lines changed
  • platforms/group-charter-manager-api/src/web3adapter/watchers

1 file changed

+15
-0
lines changed

platforms/group-charter-manager-api/src/web3adapter/watchers/subscriber.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,21 @@ console.log("hmm?")
412412

413413
console.log("Group updated with ename:", evaultResult.w3id);
414414

415+
// Wait 20 seconds before triggering handleChange to allow eVault to stabilize
416+
console.log("Waiting 20 seconds before syncing updated group data...");
417+
setTimeout(async () => {
418+
try {
419+
// Fetch the updated group entity to trigger handleChange
420+
const updatedGroup = await groupRepository.findOne({ where: { id: group.id } });
421+
if (updatedGroup) {
422+
console.log("Triggering handleChange for updated group with ename after timeout");
423+
await this.handleChange(updatedGroup, "groups");
424+
}
425+
} catch (error) {
426+
console.error("Error triggering handleChange after timeout for group:", group.id, error);
427+
}
428+
}, 20000); // 20 seconds timeout
429+
415430
} catch (error: any) {
416431
console.error("Error creating eVault for group:", group.id, error);
417432
throw error; // Re-throw to be caught by the caller

0 commit comments

Comments
 (0)