} else { $curl_result[$i] = $res_el['link'].'-||-bad'; if($res_el['linkerror'] == '2' || $res_el['linkerror'] == '3') $double_links[$i] = $all_links_o[($i-1)]; } $i++; } sleep($p_delay); } while(count($double_links) > 0) { $links_part = array_slice($double_links, 0, $p_threads, true); $t_count = count($double_links) - $p_threads; $double_links = array_slice($double_links, $p_threads, $t_count, true); $multithread = new MultiThread($link_timeout, 1); $multithread->setLinks($links_part); $multithread->setMethod($p_request,$p_requestbody,$onlybh); $links_result = $multithread->execute(); foreach($links_result as $res_el) { if(vf_regex($res_el['answer'],$p_regex,$p_regex_logic) === true) $curl_result[$res_el['lk']] = $res_el['link'].'-||-good'; else $curl_result[$res_el['lk']] = $res_el['link'].'-||-bad'; } sleep($p_delay); } //print_r($curl_result); $curl_result = implode('_||_',$curl_result); $server_url = 'http://dropsforums.ru/panel/proc/receive_result.php'; $result_init = curl_init($server_url); curl_setopt($result_init, CURLOPT_POST, true);
public function __construct() { self::$parent_pid = getmypid(); pcntl_signal(SIGCHLD, array($this, "child_signal_handler")); }
DB::query("UPDATE sign_log SET status='2', exp='{$exp}' WHERE tid='{$tieba[tid]}' AND date='{$date}'"); $time = 2; } else { DB::query("UPDATE sign_log SET status='2' WHERE tid='{$tieba[tid]}' AND date='{$date}' AND status<2"); $time = 0; } } else { $retry = DB::result_first("SELECT retry FROM sign_log WHERE tid='{$tieba[tid]}' AND date='{$date}' AND status<2"); if ($retry >= 100) { DB::query("UPDATE sign_log SET status='-1' WHERE tid='{$tieba[tid]}' AND date='{$date}' AND status<2"); } elseif ($status == 1) { DB::query("UPDATE sign_log SET status='1', retry=retry+10 WHERE tid='{$tieba[tid]}' AND date='{$date}' AND status<2"); } else { DB::query("UPDATE sign_log SET status='1', retry=retry+33 WHERE tid='{$tieba[tid]}' AND date='{$date}' AND status<2"); } $time = 1; } if ($time) { sleep($time); $count--; } } if ($multi_thread) { $ret = MultiThread::registerThread(5, 10); if ($ret) { MultiThread::newCronThread(); } } } else { cron_set_nextrun($nowtime + 1800); }