Home  >  Article  >  Backend Development  >  这段代码总是在2m左右出现504 Proxy Timeout异常,什么原因

这段代码总是在2m左右出现504 Proxy Timeout异常,什么原因

WBOY
WBOYOriginal
2016-06-13 12:47:56893browse

这段代码总是在2m左右出现504 Proxy Timeout错误,什么原因?

本帖最后由 helloqhq 于 2010-12-23 10:03:26 编辑 这段代码当$fucknum比较大时,比如1000时,就会出现504 Proxy Timeout错误,而且报错后程序不再继续执行,好像停止不前了,$fucknum值比较小时不会出现这个错误,什么原因?请各位指点下
function autonewnewegg($arr){<br>
            $fucknum=intval($arr['fucknum']);  // # 获取抓取条数的整数值<br>
            $outime=$fucknum*2+100;<br>
            set_time_limit($outime);//设置脚本执行时间<br>
            $nextnum=20;//连续查找10次不存在则终止<br>
            $sn=$arr['sn'];<br>
            <br>
            $acl=explode("-",$sn);<br>
            $acl_1=preg_replace('/[^0-9]+/','',$acl[1]);        //二次<br>
            $a=$b=0;                                            //二次<br>
            <br>
            while($fucknum>0){<br>
                $arr1 = $arr2 = array();<br>
                if($acl[2]
                    $acl[2]=str_pad("$acl[2]",3,'0',STR_PAD_LEFT);<br>
                    $acl_1=str_pad("$acl_1",2,'0',STR_PAD_LEFT);<br>
                    $acl[1]="c".$acl_1;<br>
                    $arr_in=implode("-",$acl);<br>
            <br>
                    $url=$GLOBALS['competitor'][1]['product'].$arr_in.'.htm';<br>
                    if($acl[2]==999){<br>
                        $acl_1=$acl_1+1;<br>
                        $acl[2]=001;<br>
                    }else {<br>
                        ++$acl[2];<br>
                    }<br>
                }elseif($acl[0]
                    $acl[0]=str_pad("$acl[0]",2,'0',STR_PAD_LEFT); <div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn