Re: Mail::Queue put error
| From: | bertrand Gugger | Date: | Mon, 13 Feb 2006 17:57:20 +0000 |
| Subject: | Re: Mail::Queue put error | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-22950@lists.php.net to get a copy of this message | ||
Bonsoir,
Jason Yonk wrote:
Sorry it took me so long to get back. Your suggestions worked, of course, and now I have my program working well for a limited number of users. So, thank you very, very, very much for that. Now I have a new issue that I'm not sure is a PEAR issue or a PHP/MySQL issue. My clients' email list is about 5,000+ registered emails. I do a select on their list and while looping through the results, change the $to variable to the new email address and call put() again. The problem is that this seems to be timing out at around 1395 inserts into the queue table. Yes, php default processing time limit is 30 seconds.You can change it using http://fr2.php.net/manual/en/function.set-time-limit.php *set_time_limit*(0); // puts it unlimited
Have you ever encountered anything like that? What would you recommend for handling a list that large? That list is constantly growing too (not quickly, but by a dozen or so emails a month). Make chunks, once the 'A', then 'B' .... 'Z', then the restDivide to reign ! It will also balance nicely your servers.
Thanks a million in advance! Yo ! a million customers !(I mean your mail customers :) ) -- toggg >Jason > >-----Original Message----- >From: Justin Patrin [mailto:papercrane@gmail.com] >Sent: Friday, February 03, 2006 2:36 PM >To: Jason Yonk >Cc: Lorenzo Alberton; pear-general@lists.php.net >Subject: Re: [PEAR] Mail::Queue put error > >On 2/3/06, Jason Yonk <jason@jmai.net> wrote: > > >>Lorenzo, >> >>Thanks for getting back to me so quickly! I copied down the files and >>uploaded them to the host, and it seemed to take care of the >> >> >"nextid()" > > >>problem. However, now it's giving me the same error but on "quote()" >>(this is being thrown by sendMailsInQueue($max_amount_mails)). I >> >> >tried > > >>adding PEAR:isError for the $mail_queue variable, but I'm just seeing >>the standard error, and not my print statement or anything else. >> >>What causes the undefined function error? Is it a bad reference in >>db.php, or could there be something wrong with my code? How can I go >>about debugging this so that I don't have to bother anyone (and learn >>the code better)? >> >> > >This is caused by ignoring PEAR_Errors. Some function is returning a >PEAR_Error and you're not checking it and using it as if it were a DB. >Are you perhaps passing a DB object into Mail_Queue? Check to make >sure it's not an error first, as Lorenzo suggested. Another way to do >it is to set an error handler: >function handlePearError($err) { > die($err->getMessage().' '.$err->getUserInfo()); >} >PEAR::setErrorHandler(PEAR_ERROR_CALLBACK, 'handlePearError'); > > > >>Thanks again! >> >>J >> >>-----Original Message----- >>From: Lorenzo Alberton [mailto:l.alberton@quipo.it] >>Sent: Friday, February 03, 2006 1:17 PM >>To: Jason Yonk >>Cc: pear-general@lists.php.net >>Subject: Re: [PEAR] Mail::Queue put error >> >>Jason Yonk wrote: >> >> >>>Seems that trying to call the put function in Mail::Queue is >>> >>> >throwing > > >>>the following error in Mail/Queue/Container/db.php. I must've >>> >>> >>installed >> >> >>>something wrong, but can't seem to figure out how/what? >>> >>>Here's the error: Fatal error: Call to undefined function: nextid() >>> >>> >>in >> >> >/home/virtual/site51/fst/var/www/html/testfolder/Mail/Queue/Container/db > > >>>..php on line 189 >>> >>> >>1) please use the CVS version: >>http://cvs.php.net/viewcvs.cgi/pear/Mail_Queue/ >> >>2) always check for errors after every method call >> >>$res = $mq->doSth(); >>if (PEAR::isError($res)) { >> //uh-oh >>} >> >> >> >> >>>PS - I tried copying the function from DB/mysql.php into db.php, but >>> >>> >I > > >>>still got the same error. >>> >>> >>don't edit the pear files. Unless there are some >>serious bugs, this is not necessary. >> >> >> > > >-- >Justin Patrin > > >