evgrmn / tmatic

Tmatic is a cryptocurrency platform designed for automated trading on the Bitmex, Bybit and Deribit crypto exchanges.
https://www.tmatic.org
GNU General Public License v3.0
25 stars 6 forks source link

RuntimeError: main thread is not in main loop #189

Closed nikolayromenskiy closed 4 months ago

nikolayromenskiy commented 4 months ago

2024-04-27 18:40:31,517 - api.bybit.agent - INFO - In trading_history - sending get_executions() - category - linear - startTime - 2024-04-27 13:51:38+00:00 Bybit - loading trading history, startTime=2024-04-27 13:51:38+00:00, received: 1 records. 2024-04-27 18:40:32,429 - api.bybit.agent - INFO - In trading_history - sending open_orders() - parameters - {'openOnly': 0, 'limit': 50, 'category': 'spot', 'cursor': 'no'} 2024-04-27 18:40:32,651 - api.bybit.agent - INFO - In trading_history - sending open_orders() - parameters - {'openOnly': 0, 'limit': 50, 'category': 'inverse', 'settleCoin': 'BTC', 'cursor': 'no'} ___error RuntimeError Traceback (most recent call last): File "/home/rmn/tmatic_240424/api/bybit/errors.py", line 18, in decorator result = method(*args, **kwargs) File "/home/rmn/tmatic_240424/api/bybit/ws.py", line 306, in __handle_order self.transaction(row=row) File "/home/rmn/tmatic_240424/functions.py", line 404, in transaction Function.orders_processing(self, row=row, info=info) File "/home/rmn/tmatic_240424/functions.py", line 501, in orders_processing info_display( File "/home/rmn/tmatic_240424/display/functions.py", line 16, in info_display disp.text_info.configure(state='normal') File "/usr/lib/python3.10/tkinter/init__.py", line 1675, in configure return self._configure('configure', cnf, kw) File "/usr/lib/python3.10/tkinter/init.py", line 1665, in _configure self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) RuntimeError: main thread is not in main loop Aborted (core dumped)

evgrmn commented 4 months ago

Does this error occur regularly?

evgrmn commented 4 months ago

This is a common problem because Tkinter does not support multithreading. If the widget is updated outside of the main loop, an error appears. Currently there is no such line "disp.text_info.configure(state='normal')". The program works correctly.