數(shù)據(jù)庫(kù)的執(zhí)行幾乎不耗費(fèi)時(shí)間,不是數(shù)據(jù)庫(kù)等待時(shí)間
請(qǐng)問(wèn)還可以從哪些方面去找問(wèn)題
根據(jù)帖子http://wtbis.cn/q/8287進(jìn)行了修改,依然報(bào)錯(cuò)
首先開(kāi)自定義進(jìn)程
public function onWorkerStart()
{
$endPoint = '1';
$accessId = "2";
$accessKey = "3";
//隊(duì)列名稱
$queueName = "buyorder-settle";
$client = new Client($endPoint, $accessId, $accessKey);
$queue = $client->getQueueRef($queueName);
pcntl_signal(SIGINT, function () {
Worker::stopAll();
});
while (true) {
try {
$t1_start=time();
$res = $queue->receiveMessage(1);
$receiptHandle = $res->getReceiptHandle();
//接收消息
$r = $res->getMessageBody();
$update_o = [
'buyorder_status' => "finish",
];
$r1 = Db::name("buy_order")
->where("buyorder_id", $r['order_id'])->update($update_o);
if ($r1) {
$delete_action = $queue->deleteMessage($receiptHandle);
$haoshi=time()-$t1_start;
print(date('Y-m-d H:i:s')."---完成--耗時(shí)".$haoshi."s"."\r\n");
pcntl_signal_dispatch();
}
} catch (\Throwable $throwable) {
}
}
}
MNS應(yīng)該如何填寫參數(shù)
根據(jù)這個(gè)帖子改了還是不行
http://wtbis.cn/q/8287
http://wtbis.cn/q/9385