Skip to content

Commit

Permalink
Update app.js
Browse files Browse the repository at this point in the history
Resolve bug when heartbeats addition blocks orchestration
  • Loading branch information
vladostp authored Mar 4, 2021
1 parent fba5e80 commit 8352c34
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion orchestrator/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,18 @@ async function main () {
// Listen events
chain.listenEvents(heartbeats, orchestrator, MNEMONIC);

// Add heartbeats and orchestrate every 10 seconds
// Add heartbeats every 10 seconds
setIntervalAsync(async () => {
try {
await chain.addHeartbeat(NODE_GROUP_ID, orchestrator.mode, MNEMONIC);
} catch (error) {
console.error(error);
}
}, 10000);

// Orchestrate every 10 seconds
setIntervalAsync(async () => {
try {
// Orchestrating service
await orchestrator.orchestrateService();
} catch (error) {
Expand Down

0 comments on commit 8352c34

Please sign in to comment.