File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -1226,16 +1226,32 @@ show_config() {
12261226
12271227# Update configuration
12281228update_config () {
1229- precheck_for_services
1229+ check_project_setup
12301230
12311231 log_info " Updating configuration files..."
12321232
12331233 # Generate sources files
12341234 local compose_cmd=$( get_compose_cmd)
12351235 cd " $SCRIPT_DIR "
12361236 $compose_cmd -f " $COMPOSE_FILE " run --rm sources-generator
1237- $compose_cmd -f " $COMPOSE_FILE " restart pgwatch-postgres
1238- $compose_cmd -f " $COMPOSE_FILE " restart pgwatch-prometheus
1237+
1238+ # Check if containers are running before trying to restart them
1239+ local running_containers
1240+ running_containers=$( $compose_cmd -f " $COMPOSE_FILE " ps --services --filter " status=running" 2> /dev/null || true)
1241+
1242+ if echo " $running_containers " | grep -q " pgwatch-postgres" ; then
1243+ log_info " Restarting pgwatch-postgres to apply new configuration..."
1244+ $compose_cmd -f " $COMPOSE_FILE " restart pgwatch-postgres
1245+ else
1246+ log_info " pgwatch-postgres not running - configuration will be applied when it starts"
1247+ fi
1248+
1249+ if echo " $running_containers " | grep -q " pgwatch-prometheus" ; then
1250+ log_info " Restarting pgwatch-prometheus to apply new configuration..."
1251+ $compose_cmd -f " $COMPOSE_FILE " restart pgwatch-prometheus
1252+ else
1253+ log_info " pgwatch-prometheus not running - configuration will be applied when it starts"
1254+ fi
12391255
12401256 log_success " Configuration updated"
12411257}
You can’t perform that action at this time.
0 commit comments