Skip to content

Commit

Permalink
fix: getting version from drive
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Oct 18, 2024
1 parent 4d6d299 commit f088a3c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
14 changes: 10 additions & 4 deletions packages/dashmate/src/status/scopes/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export default function getPlatformScopeFactory(
const info = {
dockerStatus: null,
serviceStatus: null,
version: null,
};

try {
Expand Down Expand Up @@ -189,17 +190,22 @@ export default function getPlatformScopeFactory(
} else {
throw e;
}
}

try {
const driveVersionResult = await dockerCompose.execCommand(
config,
'drive_abci',
'drive-abci version',
);

console.dir(driveVersionResult);

if (driveVersionResult.exitCode === 0) {
info.version = driveVersionResult.stdout;
info.version = driveVersionResult.out.trim();
} catch (e) {
// Throw an error if it's not a Drive issue
if (!(e instanceof DockerComposeError
&& e.dockerComposeExecutionResult
&& e.dockerComposeExecutionResult.exitCode !== 0)) {
throw e;
}
}
}
Expand Down
15 changes: 5 additions & 10 deletions packages/rs-drive-abci/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,11 @@ fn main() -> Result<(), ExitCode> {

runtime.spawn(handle_signals(cancel.clone(), loggers));

let result = match cli.run(&runtime, config, cancel) {
Ok(()) => {
tracing::debug!("shutdown complete");
Ok(())
}
Err(e) => {
tracing::error!(error = e, "drive-abci failed: {e}");
Err(ExitCode::FAILURE)
}
};
let result = cli.run(&runtime, config, cancel).map_err(|e| {
tracing::error!(error = e, "drive-abci failed: {e}");

ExitCode::FAILURE
});

drop(runtime_guard);
runtime.shutdown_timeout(Duration::from_millis(SHUTDOWN_TIMEOUT_MILIS));
Expand Down

0 comments on commit f088a3c

Please sign in to comment.