-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes bug where if the container was already running, running start w…
…ould error with unintuitive error.
- Loading branch information
1 parent
1ef6dad
commit adb05d5
Showing
1 changed file
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
import { startEos } from './utils'; | ||
import { startEos, eosIsReady, stopContainer } from './utils'; | ||
|
||
/** | ||
* Starts EOS and throws caught errors | ||
* @note This should handle caught errors | ||
* Stops EOS docker container if it's running, then starts it. | ||
* @note Keep alive setup is incomplete | ||
* @author Kevin Brown <github.com/thekevinbrown> | ||
*/ | ||
startEos().catch(error => { | ||
throw error; | ||
const run = async () => { | ||
// Stop running instances for fresh test environment | ||
if (await eosIsReady()) { | ||
await stopContainer(); | ||
} | ||
|
||
await startEos(); | ||
}; | ||
|
||
run().catch(async error => { | ||
process.exitCode = 1; | ||
console.log(error); | ||
}); |