Reply
Curl timeout breaks script
Old 11-05-2009, 11:59 AM Curl timeout breaks script
Junior Talker

Posts: 3
Name: Kaido
Trades: 0
So im having difficulties with skipping timeout error in curl
my script calls different functions my problem is lets say if in function2 is curl timeout error it wont continue with function3 but kills entire script. Is there any way to skip function2 (if there is timeout error) and continue with function3

PHP Code:
// Start calling functions

   
function1();
   
function2();
   
function3();
   
function4();
   
function5(); 
kristallaju is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 11-05-2009, 01:42 PM Re: Curl timeout breaks script
Skilled Talker

Posts: 61
Name: John
Trades: 0
I have no idea if this would work; but:
PHP Code:
$time time();
$cutoff $time 3600;
while (
$time $cutoff)
 {
  
// ## Do whatever
  
$time time();
 } 
I suppose it would depend on how/when you updated $time.
Envision_frodo is offline
Reply With Quote
View Public Profile
 
Old 11-06-2009, 10:25 AM Re: Curl timeout breaks script
mtishetsky's Avatar
King Spam Talker

Posts: 1,166
Name: Mike
Location: Mataro, Spain
Trades: 0
If functionN+1's execution does not depend on functionN's result then you may start external script for each function in background with exec:
PHP Code:
$cmd "php /path/to/script.php $func_num > /path/to/logfile.log &";
exec($cmd$out$ret); 
and in script.php use "switch" or a bunch of "if"s to execute proper function.

Also it would be useful to see what exactly you are doing in your functions.
__________________
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to Curl timeout breaks script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.10730 seconds with 13 queries