Skip to content

Commit

Permalink
feat+chore: Added automatic restarts, minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
xadahiya committed Nov 11, 2024
1 parent e6ecff4 commit 90c168a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
13 changes: 3 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ echo "Selected DOCKER_NETWORK_SUBNET: ${DOCKER_NETWORK_SUBNET}"
# Check if the first argument is "test"
if [ "$1" = "test" ]; then
echo "Running subnet calculation tests..."

# Test function for subnet calculation
test_subnet_calculation() {
local test_slot_id=$1
Expand All @@ -73,7 +73,7 @@ if [ "$1" = "test" ]; then

if [ $SUBNET_THIRD_OCTET -eq $expected_third_octet ]; then
echo "Test passed for SLOT_ID $test_slot_id: $SUBNET"
else
else
echo "Test failed for SLOT_ID $test_slot_id: Expected 172.18.$expected_third_octet.0/24, got $SUBNET"
fi
}
Expand Down Expand Up @@ -133,13 +133,6 @@ else
echo "Found LOCAL_COLLECTOR_PORT ${LOCAL_COLLECTOR_PORT}"
fi

if [ -z "$ENABLE_CRON_RESTART_LOCAL_COLLECTOR" ]; then
export ENABLE_CRON_RESTART_LOCAL_COLLECTOR=true
echo "ENABLE_CRON_RESTART_LOCAL_COLLECTOR not found in .env, setting to default value ${ENABLE_CRON_RESTART_LOCAL_COLLECTOR}"
else
echo "Found ENABLE_CRON_RESTART_LOCAL_COLLECTOR ${ENABLE_CRON_RESTART_LOCAL_COLLECTOR}"
fi

if [ "$MAX_STREAM_POOL_SIZE" ]; then
echo "Found MAX_STREAM_POOL_SIZE ${MAX_STREAM_POOL_SIZE}";
else
Expand Down Expand Up @@ -216,4 +209,4 @@ if [ "$DEVMODE" = "false" ]; then
$COMPOSE_CMD -f docker-compose.yaml $PROFILES pull
fi

$COMPOSE_CMD -f docker-compose.yaml $PROFILES up -V --abort-on-container-exit
$COMPOSE_CMD -f docker-compose.yaml $PROFILES up -V --remove-orphans
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ services:
- BLOCK_TIME=$BLOCK_TIME
- MAX_STREAM_POOL_SIZE=$MAX_STREAM_POOL_SIZE
- STREAM_POOL_HEALTH_CHECK_INTERVAL=$STREAM_POOL_HEALTH_CHECK_INTERVAL
- ENABLE_CRON_RESTART_LOCAL_COLLECTOR=$ENABLE_CRON_RESTART_LOCAL_COLLECTOR
networks:
- custom_network
restart: on-failure:10
ulimits:
nofile:
soft: 65536
Expand Down

0 comments on commit 90c168a

Please sign in to comment.