File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -39,20 +39,30 @@ if not exist "%INFLUXDB_DIR%\influxd.exe" (
3939)
4040
4141echo Starting InfluxDB...
42- start /B " %INFLUXDB_DIR% \influxd.exe" -config influxdb.conf
42+ start /B " " " %INFLUXDB_DIR% \influxd.exe" -config influxdb.conf
4343if errorlevel 1 (
4444 echo ERROR: Failed to start InfluxDB
4545 exit /b 1
4646)
4747
48+ REM Wait a moment for InfluxDB to start
49+ timeout /t 3 /nobreak > nul
50+
51+ REM Verify the process is running
52+ tasklist /FI " IMAGENAME eq influxd.exe" 2 > nul | find /I " influxd.exe" > nul
53+ if errorlevel 1 (
54+ echo ERROR: InfluxDB process is not running
55+ exit /b 1
56+ )
57+
4858echo Waiting for InfluxDB to be ready...
49- timeout /t 10 /nobreak > nul
59+ timeout /t 7 /nobreak > nul
5060
51- REM Check if InfluxDB is responding
61+ REM Check if InfluxDB is responding using PowerShell with timeout
5262set /a max_attempts = 30
5363set /a attempt = 0
5464:health_check
55- curl -s http://localhost:8086/ping > nul 2 >& 1
65+ powershell -Command " try { $r = Invoke-WebRequest -Uri ' http://localhost:8086/ping' -TimeoutSec 1 -UseBasicParsing -ErrorAction Stop; if ($r.StatusCode -eq 204) { exit 0 } else { exit 1 } } catch { exit 1 } " > nul 2 >& 1
5666if errorlevel 1 (
5767 set /a attempt += 1
5868 if !attempt! lss %max_attempts% (
You can’t perform that action at this time.
0 commit comments