<?php
//运行任务
require 'common.php';

$count=20; //每次运行的代点任务数量
$interval=50; //每条任务间隔时间(微秒)

$today=date("Y-m-d ").'00:00:00';

$rs=$DB->query("SELECT * FROM qiu_job WHERE lasttime<='$today' or lasttime is null order by jobid desc limit $count");
while($row = $DB->fetch($rs))
{
	get_curl('http://www.dqiuqiu.com/php/do.php?url='.$row['id']);
	$DB->query("update qiu_job set lasttime='$date' where jobid='{$row['jobid']}'");
	@usleep($interval*1000);
}
echo 'ok!';