Skip to content

Commit

Permalink
Only start services in stream chain if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
MorningLightMountain713 committed Jan 9, 2025
1 parent ef55987 commit f8b4912
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions ZelBack/src/services/fluxService.js
Original file line number Diff line number Diff line change
Expand Up @@ -1851,13 +1851,17 @@ async function streamChain(req, res) {
log.error(error);
} finally {
// start services
daemonStartRequired = false;
if (isArcane) {
await serviceHelper.runCommand('systemctl', { runAsRoot: false, params: ['start', 'fluxd.service', 'flux-watchdog.service'] });
} else {
await serviceHelper.runCommand('systemctl', { runAsRoot: true, params: ['start', 'zelcash.service'] });
await serviceHelper.runCommand('pm2', { runAsRoot: false, params: ['start', 'watchdog', '--watch'] });
if (daemonStartRequired) {
daemonStartRequired = false;

if (isArcane) {
await serviceHelper.runCommand('systemctl', { runAsRoot: false, params: ['start', 'fluxd.service', 'flux-watchdog.service'] });
} else {
await serviceHelper.runCommand('systemctl', { runAsRoot: true, params: ['start', 'zelcash.service'] });
await serviceHelper.runCommand('pm2', { runAsRoot: false, params: ['start', 'watchdog', '--watch'] });
}
}

lock = false;
}
}
Expand Down

0 comments on commit f8b4912

Please sign in to comment.