How to perform an action only one time despite multithreading

player

Client
Регистрация
06.06.2011
Сообщения
154
Благодарностей
16
Баллы
0
Hey, i've almost finished my mass email processing template. The only thing i want to do yet:

I want to login to my account and move all emails from the spam folder into my inbox automatically, after that the mass email processing can start.

What can i do that this action is performed only one time in multithreading mode. If i have multiple threads, it will try to login and move the emails into my inbox every time an instance starts. I don't want to create an extra template for that and i can't delete the spam folder, so this is necessary...

thx
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
Attempts to 1
 

player

Client
Регистрация
06.06.2011
Сообщения
154
Благодарностей
16
Баллы
0
Attempts to 1 in Zennoposter?

But the template has to run 130 times, for 130 emails. And only one time for copying the emails in the right folder. After that Zennoposter can perform the email processing for all 130 emails from my inbox.
 

sMax

Client
Регистрация
04.05.2011
Сообщения
132
Благодарностей
49
Баллы
28
global variable --> mov2inbox
mov2inbox:=0


if mov2inbox= 0
--movcrap2inbox branch
--mov2inbox:=1 (set to 1, or use yes/no, whatever floats your boat)

processmycrap
because you have this in all your threads you can' reset mov2inbox :=0 here, you'll have to do that manually before you start the next processing or build a driver structure around this.

BUT

another approach would be to leave it like you have it and just test if there is email to be moved to the inbox,
if there is ...move it , otherwise fall through and process mail

The added benefit of this is that even if email comes in your spam box while you are already processing, you can move it and process it.
 
  • Спасибо
Реакции: player

player

Client
Регистрация
06.06.2011
Сообщения
154
Благодарностей
16
Баллы
0
Hey, yeah nice and easy idea. I create a successful and an unsuccessful exit and both are connected to my email processing. I think this will slower my template but this should work, i'll try it out :-)

Any other ideas for that? Could be helpful in many cases to perform an action only once in multithreading mode.
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
Attempts to 1 in Zennoposter?

But the template has to run 130 times, for 130 emails. And only one time for copying the emails in the right folder. After that Zennoposter can perform the email processing for all 130 emails from my inbox.
Sorry, misunderstood what you were trying to do. You would want to make a variable and when the variable reaches a value, step out to do your other shtuff.
 
  • Спасибо
Реакции: player

player

Client
Регистрация
06.06.2011
Сообщения
154
Благодарностей
16
Баллы
0
Thx! Do i have to use a counter for that? Doesn't the counter start from 1 in every instance?
 

sMax

Client
Регистрация
04.05.2011
Сообщения
132
Благодарностей
49
Баллы
28
I wouldn't use a counter, you only need a yes /no switch

To have minimum slow down, combine my two suggestions
global variable --> mov2inbox

if mov2inbox ==0
Check if there are emails in spam
yes-> move to inbox, set mov2inbox:=1 if move completes successfully

processmycrap

Otherwise you need a driver, thread control from within a template (which can be done calling an outside script)
Hope this helps
 
  • Спасибо
Реакции: player

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