Skip to content

Commit a3fdd53

Browse files
authored
feat: timeout container status checks after 1s (#18)
Under unknown circumstances, `docker` commands may hang up for minutes. Since the LS Toolkit activation requires running some `docker` commands such as `docker inspect`, we now abort the command after 1s.
1 parent 48f244e commit a3fdd53

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/utils/container-status.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ async function getContainerStatus(
191191
containerName: string,
192192
): Promise<ContainerStatus> {
193193
return new Promise((resolve) => {
194+
// timeout after 1s
195+
setTimeout(() => resolve("stopped"), 1_000);
196+
194197
exec(
195198
`docker inspect --format {{.State.Status}} ${containerName}`,
196199
(error, stdout) => {

0 commit comments

Comments
 (0)