File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -66,14 +66,19 @@ jobs:
66
66
run : pip install MetaTrader5
67
67
68
68
- name : Run Python inline script
69
+ shell : pwsh
69
70
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 ; \
71
72
for attempt in range(12) : \
72
73
if mt5.initialize() : \
73
74
print('MT5 initialized successfully'); \
74
75
mt5.shutdown(); \
75
- sys.exit(0); \
76
+ success = True; \
77
+ break; \
76
78
else : \
77
79
print(f'Attempt {attempt+1} : Not ready yet, sleeping...'); \
78
80
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
+
You can’t perform that action at this time.
0 commit comments