1.修复上传漏洞和SQL注入漏洞-修复服务端无法启动的问题
This commit is contained in:
@@ -16,15 +16,10 @@ use Workerman\Worker;
|
||||
*/
|
||||
class PlayxJobs
|
||||
{
|
||||
protected Client $http;
|
||||
protected ?Client $http = null;
|
||||
|
||||
public function __construct()
|
||||
public function onWorkerStart(Worker $worker): void
|
||||
{
|
||||
// 确保定时任务只在一个 worker 上运行
|
||||
if (!Worker::getAllWorkers()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->http = new Client([
|
||||
'timeout' => 20,
|
||||
'http_errors' => false,
|
||||
@@ -34,11 +29,21 @@ class PlayxJobs
|
||||
Timer::add(60, [$this, 'retryFailedGrants']);
|
||||
}
|
||||
|
||||
protected function getHttp(): ?Client
|
||||
{
|
||||
return $this->http;
|
||||
}
|
||||
|
||||
/**
|
||||
* 轮询:已 accepted 的订单,查询终态
|
||||
*/
|
||||
public function pollTransactionStatus(): void
|
||||
{
|
||||
$http = $this->getHttp();
|
||||
if ($http === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$baseUrl = strval(config('playx.api.base_url', ''));
|
||||
if ($baseUrl === '') {
|
||||
return;
|
||||
@@ -57,7 +62,7 @@ class PlayxJobs
|
||||
foreach ($list as $order) {
|
||||
/** @var MallOrder $order */
|
||||
try {
|
||||
$res = $this->http->get($url, [
|
||||
$res = $http->get($url, [
|
||||
'query' => [
|
||||
'externalTransactionId' => $order->external_transaction_id,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user