Commit 39086e2f by yangsh

添加定时器查询订单状态,staging添加环境变量

parent fc3261c9
...@@ -32,4 +32,4 @@ MESSAGE_RELOAD=sCtztz8xYzsgR1IpZ5GohMuG9DScY5OOcI4VVEEwtg8 ...@@ -32,4 +32,4 @@ MESSAGE_RELOAD=sCtztz8xYzsgR1IpZ5GohMuG9DScY5OOcI4VVEEwtg8
MESSAGE_SHED_TIMEOUT=euUQrXFejUeyyxJbfaZQaRQfnXSqi05XMFLNfIsC0vA MESSAGE_SHED_TIMEOUT=euUQrXFejUeyyxJbfaZQaRQfnXSqi05XMFLNfIsC0vA
MESSAGE_CHARGER_SHED=MZH_wTlwMq1_GguqIRnldSbHEuyFZcqmC3Wtk7ylMD0 MESSAGE_CHARGER_SHED=MZH_wTlwMq1_GguqIRnldSbHEuyFZcqmC3Wtk7ylMD0
LOW_POWER_LIMIT=30 LOW_POWER_LIMIT=30
PAY_HOST=https://cdzpay.staging.senthink.com
...@@ -13,6 +13,8 @@ use Application\route\Api; ...@@ -13,6 +13,8 @@ use Application\route\Api;
use Src\route\Route; use Src\route\Route;
use Lib\station\gateway\Gateway; use Lib\station\gateway\Gateway;
use Lib\station\gateway\port\Port; use Lib\station\gateway\port\Port;
use Workerman\Lib\Timer;
use GuzzleHttp\Client;
class Events class Events
{ {
...@@ -33,6 +35,19 @@ class Events ...@@ -33,6 +35,19 @@ class Events
public static function onWorkerStart() public static function onWorkerStart()
{ {
Timer::add(10 * 6 * 10, function () {
$client = new Client([
'http_errors' => false
]);
$response = $client->request('POST', getenv('PAY_HOST') . '/api/wx/order/scanner', [
'form_params' => [
'key' => 'sE5jICwtbYrhnuSAUF3JTv0xXpQMG1Bfoy4aWgLP67zqKNVmd9O2HDei8lcZRk'
]
]);
});
static::$db = new Connection(getenv('DB_HOST'), getenv('DB_PORT'), getenv('DB_USERNAME'), getenv('DB_PASSWORD'), getenv('DB_DATABASE')); static::$db = new Connection(getenv('DB_HOST'), getenv('DB_PORT'), getenv('DB_USERNAME'), getenv('DB_PASSWORD'), getenv('DB_DATABASE'));
static::$redis = new \Redis(); static::$redis = new \Redis();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment