Multithreading with MySQL and List/Tables

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 039
Благодарностей
237
Баллы
63
Hello,

I'm currently working on a multithreaded messenger for some websites but can't handle the MySQL and list/tables syncing the right way:

The project uses a MySQL database with the email- and websiteaccounts to use (including columns for signup date, messages sent total, last used and so on) and in one input list (from text file) there are the needed proxystrings for my different VPN adapters.

When the project starts it updates the used account in the DB to status "running" and sets it back to "active" when the project it finished (after x messages sent), so the other threads are only using accounts with status "active" (to avoid that 2 or more threads are using the same account). Also it takes the proxystring from a txt-file to a list with "get line" and "delete line after taking". When the project is finished it puts the proxystring back to the txt-file (list) at the bottom.

In general it works like it should but from time to time there are threads crashing (e.g. with "Instance active tab not found" or the instance just crashes directly without any obvious reason). So the instance instantly goes away and does NOT set the status of the currently used account back to "active" in the DB and after a while there are no available accounts for new project runs/threads. The same issue with the proxy-list from the txt-file as the currently used proxystring is not put back to the list, is lost and after a while the complete list is empty and it has no more available proxies for running.

How can this issues be solved? Unfortunately I don't speak Russian but maybe someone can give me a hint or link to an contest-/template article that catches that topic from the Russian section of the forum? Should not be a problem to translate :-)

Thank you guys!
 

nicanil

Client
Регистрация
06.03.2016
Сообщения
2 242
Благодарностей
1 805
Баллы
113
Hi.
You can use BadEnd - if an unexpected error occurs execution will go to BadEnd and there you can add actions to save data to list/DB.
 
  • Спасибо
Реакции: morpheus93

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 039
Благодарностей
237
Баллы
63
Hi.
You can use BadEnd - if an unexpected error occurs execution will go to BadEnd and there you can add actions to save data to list/DB.
Thank you for your advice. Generelly I use Good and Bad end in projects but it seems that I had some false logic in the concerned project at the Bad end cube. Because of your advice I had a closer look and found it. Hope it solves the issue.

Thank you!
 
  • Спасибо
Реакции: nicanil

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)