Skip to content

Commit

Permalink
fix: drive status report
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Oct 17, 2024
1 parent 09d1c35 commit b082afe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/dashmate/src/status/determineStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export default {
return coreIsSynced ? ServiceStatusEnum.up : ServiceStatusEnum.wait_for_core;
}

if (dockerStatus === DockerStatusEnum.not_started) {
return ServiceStatusEnum.stopped;
}

return ServiceStatusEnum.error;
},
};
8 changes: 5 additions & 3 deletions packages/dashmate/test/unit/status/scopes/platform.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import ContainerIsNotPresentError
from '../../../../src/docker/errors/ContainerIsNotPresentError.js';
import providers from '../../../../src/status/providers.js';
import determineStatus from '../../../../src/status/determineStatus.js';
import getConfigMock from '../../../../src/test/mock/getConfigMock.js';
Expand Down Expand Up @@ -377,7 +379,7 @@ describe('getPlatformScopeFactory', () => {
mockDetermineDockerStatus.withArgs(mockDockerCompose, config, 'drive_tenderdash')
.returns(DockerStatusEnum.running);
mockDetermineDockerStatus.withArgs(mockDockerCompose, config, 'drive_abci')
.throws();
.throws(new ContainerIsNotPresentError('drive_abci'));
mockDockerCompose.execCommand.returns({ exitCode: 0, out: '' });
mockMNOWatchProvider.returns(Promise.resolve('OPEN'));

Expand Down Expand Up @@ -430,8 +432,8 @@ describe('getPlatformScopeFactory', () => {
network: 'test',
},
drive: {
dockerStatus: null,
serviceStatus: null,
dockerStatus: DockerStatusEnum.not_started,
serviceStatus: ServiceStatusEnum.stopped,
},
};

Expand Down

0 comments on commit b082afe

Please sign in to comment.