开发者

Howto perform actions on hundrets of users (Cronjob)

I am working on a Facebook App. The main concept: Every 3 days the app checks the profile of the user an (maybe) post something to this wall.

I was wondering how to build a cronjob (with PHP) which can handle a lot of u开发者_JAVA百科sers. This is about the software design, not how to use the facebook api.

I am sure this single call would lead to a timeout:

while($user) {
  // Do a lot of stuff like posting to the wall
}

Thanks for helping.


When running PHP on the commandline (php-cli SAPI) there is no timeout. If you have to use the CGI sapi, simply set_time_limit(0); (or get the cli sapi as that's the proper one for stuff like cronjobs)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜