File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 66 build :
77 strategy :
88 matrix :
9- os : [windows-latest, windows-2022] # run on both Win runners
9+ os : [windows-latest, windows-2022]
1010 runs-on : ${{ matrix.os }}
1111 steps :
1212 - name : Checkout repository
2727 - name : Install MetaTrader5
2828 run : |
2929 $process = Start-Process -FilePath ".\mt5setup.exe" -ArgumentList "/auto", "/portable" -PassThru
30- $process.WaitForExit(300000) # 5 minutes timeout
30+ $process.WaitForExit(300000)
3131 if (-not $process.HasExited) {
3232 Write-Host "MT5 installer stuck, killing..."
3333 Stop-Process -Id $process.Id -Force
@@ -66,17 +66,14 @@ jobs:
6666 run : pip install MetaTrader5
6767
6868 - name : Run Python inline script
69- shell : pwsh
7069 run : |
71- python -c "import MetaTrader5 as mt5; import time; print('Testing MT5 initialization...'); \
70+ python -c "import MetaTrader5 as mt5; import time; print('Testing MT5 initialization...'); import sys; \
7271for attempt in range(12) : \
7372 if mt5.initialize() : \
7473 print('MT5 initialized successfully'); \
7574 mt5.shutdown(); \
76- break ; \
75+ sys.exit(0) ; \
7776 else : \
7877 print(f'Attempt {attempt+1} : Not ready yet, sleeping...'); \
7978 time.sleep(5); \
80- else : \
81- print('Failed to initialize MT5 after waiting.'); \
82- exit(1)"
79+ print('Failed to initialize MT5 after waiting.'); sys.exit(1)"
You can’t perform that action at this time.
0 commit comments