@tombarkley said in Threads bug:
I have 2 scripts created - one to check proxies can access a site (writes them to file), and another to use these proxies (reads from this file)
The first script runs fine, I run on 10 threads. When 1 thread ends, it creates a new thread and continues until the file is empty. As expected.
However the second script runs X threads which is a random number between Y and Z. In this case, when 1 ends another thread is not created. Changing this to a fixed integer fixes the problem.
I assume this is just a small bug that could be easily fixed, as ideally I would like to have a different num of threads on each run (for time or resource balancing)
BAS 21.7.2
Chrome version 68.0.3440.106
According to the description, you can guess for a long time. Send a script, I will look.
@caplaz
Is that the correct method?
Yes, this will work.
Can I write to the csv file?
Yes, there is action called Write File(which also has append switch).
Can also use csv_generate api for proper escaping.
Action "Custom" and
[[CSV_LINE]] = csv_generate(["a","b","c"],",")
Or should that be done in a seperate file?
Better use database, not csv
I want my threads to loop forever but no matter what I do they eventually end. Sometimes with success and sometimes with error.
If you have any failure during thread run, for eaxmple failed to load with proxy error, the thread will end. And as long as you set "use each line one time" to resource, it won't be used again.
Ending with success is strange, probably, because you are using labels inside loops, 20 version has good explanation about this:
There are two types of goto: long and short. Short move is performed if goto and label are located inside same block (has one parent). This type of move preserves execution history and script continues afterward. In other cases long move is performed, which clears execution history. Long move case is perfect if you are jumping on script start, but if you move inside loop, you must use another move to leave it, otherwise thread will stop with success message.
Anyway, if you have some code, that may return error, just wrap it inside ignore errors action.
You can also wrap whole list of actions that you want to do with account inside ignore errors block.
Like this
0_1500075786806_listfromfile-loop.xml