-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathboot.bat
More file actions
39 lines (30 loc) · 829 Bytes
/
boot.bat
File metadata and controls
39 lines (30 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@echo off
cd /d "%~dp0"
:: --- Run git pull once after startup ---
echo Checking for updates after app start...
git pull
if errorlevel 1 (
echo Could not pull latest code. Continuing anyway...
)
:: --- Start background loop for 12-hour git pulls ---
start "" cmd /c "call :GitUpdater"
:: --- Main crash-recovery loop (your old logic) ---
:loop
echo Starting stack...
php stack start
echo Running worker...
php stack run:worker
echo Crashed or stopped. Restarting in 5 seconds...
timeout /t 5 /nobreak
goto loop
:: --- Subroutine: Git updater ---
:GitUpdater
:gitloop
echo [%date% %time%] Waiting 12 hours before next git pull...
timeout /t 43200 /nobreak
echo [%date% %time%] Checking for updates...
git pull
if errorlevel 1 (
echo [%date% %time%] Could not pull latest code. Continuing anyway...
)
goto gitloop