File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -39,14 +39,10 @@ if not exist "%INFLUXDB_DIR%\influxd.exe" (
3939)
4040
4141echo Starting InfluxDB...
42- start /B " " " %INFLUXDB_DIR% \influxd.exe" -config influxdb.conf
43- if errorlevel 1 (
44- echo ERROR: Failed to start InfluxDB
45- exit /b 1
46- )
42+ powershell -Command " Start-Process -FilePath '%INFLUXDB_DIR% \influxd.exe' -ArgumentList '-config','influxdb.conf' -WindowStyle Hidden"
4743
4844REM Wait a moment for InfluxDB to start
49- timeout /t 3 /nobreak > nul
45+ ping 127.0.0.1 -n 4 > nul
5046
5147REM Verify the process is running
5248tasklist /FI " IMAGENAME eq influxd.exe" 2 > nul | find /I " influxd.exe" > nul
@@ -56,7 +52,7 @@ if errorlevel 1 (
5652)
5753
5854echo Waiting for InfluxDB to be ready...
59- timeout /t 7 /nobreak > nul
55+ ping 127.0.0.1 -n 8 > nul
6056
6157REM Check if InfluxDB is responding using PowerShell with timeout
6258set /a max_attempts = 30
@@ -66,7 +62,7 @@ powershell -Command "try { $r = Invoke-WebRequest -Uri 'http://localhost:8086/pi
6662if errorlevel 1 (
6763 set /a attempt += 1
6864 if !attempt! lss %max_attempts% (
69- timeout /t 1 /nobreak > nul
65+ ping 127.0.0.1 -n 2 > nul
7066 goto :health_check
7167 )
7268 echo WARNING: InfluxDB may not be fully ready yet
Original file line number Diff line number Diff line change @@ -9,6 +9,6 @@ REM Kill influxd.exe process
99taskkill /F /IM influxd.exe > nul 2 >& 1
1010
1111REM Wait a bit for the process to fully terminate
12- timeout /t 2 /nobreak > nul
12+ ping 127.0.0.1 -n 3 > nul
1313
1414echo InfluxDB stopped.
You can’t perform that action at this time.
0 commit comments