Re: [background process] not once, but twice
| From: | Marek Kilimajer | Date: | Tue, 27 Apr 2004 19:45:18 +0000 |
| Subject: | Re: [background process] not once, but twice | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184796@lists.php.net to get a copy of this message | ||
Jose de Zarate wrote:
hello up there. I have a somehow complex question. I've read a lot of mailing list archives on multiples websites, and 'I still haven't found what I'm looking for'. The thing is this. I have a sending-bulleting page in which you choose the kind of users you want to send the bulletin to (maybe a thousand), and then you just click on 'send bulletin'. at that point, php should make some checking that has to be done user by user, and then put the emails in a database, in order to send them later. It can spend a lot of time doing all the checking, and so I made the checking script a php script that would be executed from the command line, and I call it from the web application with a '&' and a '>test', so I put it on the background. The code would be: exec('php -f sendBulletin.php > temp &'); it -more or less- work fine. Whe I click 'send bulletin', the process start in the background and I get my page back without having to wait for it to finish. But if I try to do it again, and the previous process has not finished yet, then php will hang untill that process finishes. I have absolutely no idea of why this weird behavior happens. I just can't figure out what's going on!! Can any of you give me a clue???????Are you doing some kind of locking? For example the script locks a table while it is using it.