Skip to content

Commit fc86553

Browse files
committed
inline
1 parent 78855ac commit fc86553

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/test-metatrader5-integration.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,19 @@ jobs:
6666
run: pip install MetaTrader5
6767

6868
- name: Run Python inline script
69+
shell: pwsh
6970
run: |
70-
python -c "import MetaTrader5 as mt5; import time; print('Testing MT5 initialization...'); import sys; \
71+
python -c "import MetaTrader5 as mt5; import time; import sys; print('Testing MT5 initialization...'); success = False; \
7172
for attempt in range(12): \
7273
if mt5.initialize(): \
7374
print('MT5 initialized successfully'); \
7475
mt5.shutdown(); \
75-
sys.exit(0); \
76+
success = True; \
77+
break; \
7678
else: \
7779
print(f'Attempt {attempt+1}: Not ready yet, sleeping...'); \
7880
time.sleep(5); \
79-
print('Failed to initialize MT5 after waiting.'); sys.exit(1)"
81+
if not success: \
82+
print('Failed to initialize MT5 after waiting.'); \
83+
sys.exit(1)"
84+

0 commit comments

Comments
 (0)