Page 1 of 1

Antiflood, Throttler and Cron?

Posted: Wed Mar 18, 2009 9:52 am
by HHahn
Do the Antiflood and Throttler plugins (and maybe other parts of Swiftmailer and/or its plugins) use a cron task?

If so, how do they behave on websites where the ISP does not offer a cron task?

Re: Antiflood, Throttler and Cron?

Posted: Wed Mar 18, 2009 8:21 pm
by Chris Corbyn
They don't use cron. They just sleep().

Re: Antiflood, Throttler and Cron?

Posted: Wed Mar 25, 2009 10:20 am
by HHahn
Chris Corbyn wrote:They don't use cron. They just sleep().
Good idea.
I seem to remember that sleep() does not "consume" execution time (in terms of the maximum script execution time, 30 s or so by default). And if e-mails are intensively personalised, the advantage of clever caching will not help much, I guess.
But I presume the execution times for sending all e-mails will just add up, so much depends on the actual time needed per single e-mail message generated. So what happens if very(!) many e-mails have to be sent?

Re: Antiflood, Throttler and Cron?

Posted: Wed Mar 25, 2009 5:24 pm
by Chris Corbyn
HHahn wrote:
Chris Corbyn wrote:They don't use cron. They just sleep().
Good idea.
I seem to remember that sleep() does not "consume" execution time (in terms of the maximum script execution time, 30 s or so by default). And if e-mails are intensively personalised, the advantage of clever caching will not help much, I guess.
But I presume the execution times for sending all e-mails will just add up, so much depends on the actual time needed per single e-mail message generated. So what happens if very(!) many e-mails have to be sent?
If you have "very many" emails to send, use a cron script. PHP is not designed to run continuously, although it can be done.

Setting set_time_limit(0) will remove the timeout on command line, but then if you're running in a browser window the browser will close the connection after X minutes anyway.

A PHP host without cron? How weird. Might I suggest you poke your host about that? ;)