Skip to content

Commit a6913d6

Browse files
committed
- backup-logs target should only run when the network is running.
- add default duration in script used by target restart (default to stopping a service for 30s if no duration is provided)
1 parent 8602a2c commit a6913d6

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ log-all: current-chainstate-dir
9595
docker compose -f docker/docker-compose.yml --profile default -p $(PROJECT) logs -t -f
9696

9797
# Backup all service logs to $ACTIVE_CHAINSTATE_DIR/logs/<service-name>.log
98-
backup-logs: /usr/bin/sudo
98+
backup-logs: current-chainstate-dir /usr/bin/sudo
9999
@if [ -f .current-chainstate-dir ]; then \
100100
$(eval ACTIVE_CHAINSTATE_DIR=$(shell cat .current-chainstate-dir))
101101
if [ ! -d "$(ACTIVE_CHAINSTATE_DIR)" ]; then \
@@ -150,12 +150,13 @@ start: check-params current-chainstate-dir | check-running
150150
CHAINSTATE_DIR=$(ACTIVE_CHAINSTATE_DIR) docker compose -f docker/docker-compose.yml --profile default -p $(PROJECT) up -d $(PARAMS)
151151

152152
# restart a service with a defined servicename/duration. called script will validate PARAMS
153+
# if no duration is provided, default of 30s shall be used
153154
restart: check-params | check-running
154155
@echo "Restarting service"
155156
@echo " Params: $(PARAMS)"
156157
./docker/tests/restart-container.sh $(PARAMS)
157158

158-
# use 'stress' binary to consume cpu over a specified time
159+
# use 'stress' binary to consume defined cpu over a specified time
159160
stress:
160161
@echo "Stressing system CPU $(PARAMS)"
161162
@echo " Cores: $(CORES)"
@@ -165,7 +166,6 @@ stress:
165166
# run the test script to verify the services are all load and operating as expected
166167
test:
167168
./docker/tests/devnet-liveness.sh
168-
exit 0
169169

170170
# run the chain monitor script (loops and curls /v2/info, parsing the output to show current heights of miners)
171171
monitor:

docker/tests/restart-container.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# script to stop a container, sleep for a determinate amount of seconds, then start the container again
44
container=${1}
5-
sleep_duration=${2}
5+
sleep_duration=${2:-30}
66
function help(){
77
echo
88
echo "Usage:"

0 commit comments

Comments
 (0)