<?php

declare(strict_types=1);

namespace app\process;

use app\common\service\DepositOrderExpireService;
use Workerman\Timer;

/**
 * 每 10 秒扫描一次待支付充值单，把超时未支付订单自动标记为失败。
 */
class DepositOrderExpireTicker
{
    public function onWorkerStart(): void
    {
        Timer::add(10, static function (): void {
            DepositOrderExpireService::expirePendingOrders(null, null);
        });
    }
}

