缓存订单同步
This commit is contained in:
parent
c2384f1836
commit
414d30311c
|
@ -94,6 +94,10 @@ class Orders {
|
||||||
|
|
||||||
public static function syncFromThird(OrdersModel $order)
|
public static function syncFromThird(OrdersModel $order)
|
||||||
{
|
{
|
||||||
|
$redisKey = 'sync_order:' . $order->sn;
|
||||||
|
if (Redis::exists($redisKey)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
$got = null;
|
$got = null;
|
||||||
|
|
||||||
switch ($order->os) {
|
switch ($order->os) {
|
||||||
|
@ -144,6 +148,7 @@ class Orders {
|
||||||
if ($back) {
|
if ($back) {
|
||||||
self::finance(0, $order->id, $order->asset_price);
|
self::finance(0, $order->id, $order->asset_price);
|
||||||
}
|
}
|
||||||
|
Redis::setEx($redisKey, 600, 1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue