Skip to content

Commit

Permalink
chore: godwoken start timeout (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
keroro520 authored Apr 13, 2022
1 parent c3c9ced commit 2a1e009
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docker/layer2/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function stop-ckb-miner() {

function start-godwoken-at-background() {
log "Starting"
start_time=$(date +%s)
godwoken run -c $CONFIG_DIR/godwoken-config.toml & # &> /dev/null &
GODWOKEN_PID=$!
while true; do
Expand All @@ -35,6 +36,11 @@ function start-godwoken-at-background() {
if [ "$result" != "Godwoken not started" ]; then
break
fi
elapsed=$(( $(date +%s) - start_time ))
if [ $elapsed -gt 10 ]; then
log "ERROR: start godwoken timeout"
exit 2
fi
done
log "Godwoken started"
}
Expand Down

0 comments on commit 2a1e009

Please sign in to comment.