crontab.php 5.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. use Hyperf\Crontab\Crontab;
  3. $jobpre = env('REDIS_PREFIX') ?? 'job_';
  4. return [
  5. 'enable' => boolval(env('APP_CRONTAB',true)),
  6. // 通过配置文件定义的定时任务
  7. 'crontab' => [
  8. // 拉取闪兑钱包交易-拉usdt
  9. (new Crontab())->setName($jobpre.'transitwalletusdttrade')->setRule('*/2 * * * * *')->setCallback([App\Task\GetTransitWalletUsdtTrade::class, 'execute'])->setMemo('拉取闪兑钱包交易Usdt')->setSingleton(true),
  10. // 自动闪兑进货trx
  11. (new Crontab())->setName($jobpre.'autostocktrx')->setRule('* * * * *')->setCallback([App\Task\AutoStockTRX::class, 'execute'])->setMemo('自动闪兑trx')->setSingleton(true),
  12. // 闪兑
  13. (new Crontab())->setName($jobpre.'shanduiBonus')->setRule('*/2 * * * * *')->setCallback([App\Task\HandleShanduiBonus::class, 'execute'])->setMemo('闪兑币')->setSingleton(true),
  14. // 拉取欧意实时汇率
  15. (new Crontab())->setName($jobpre.'getoktrealtimerate')->setRule('*/5 * * * * *')->setCallback([App\Task\GetOKTRealtimeRate::class, 'execute'])->setMemo('拉取欧意实时汇率')->setSingleton(true),
  16. // 定时tg消息
  17. (new Crontab())->setName($jobpre.'sendtimingtgmessage')->setRule('* * * * *')->setCallback([App\Task\SendTimingTgMessage::class, 'execute'])->setMemo('定时tg消息')->setSingleton(true),
  18. // 闪兑通知
  19. (new Crontab())->setName($jobpre.'sendtransittgmessage')->setRule('*/2 * * * * *')->setCallback([App\Task\SendTransitTgMessage::class, 'execute'])->setMemo('闪兑通知')->setSingleton(true),
  20. // 监听交易-最新的区块V2
  21. (new Crontab())->setName($jobpre.'monitorWalletBlockv2')->setRule('*/2 * * * * *')->setCallback([App\Task\MonitorWalletBlockV2::class, 'execute'])->setMemo('监听交易v2')->setSingleton(true),
  22. // 监听交易-漏掉的区块V2
  23. (new Crontab())->setName($jobpre.'monitorWalletBlockLostv2')->setRule('*/2 * * * * *')->setCallback([App\Task\MonitorWalletBlockLostV2::class, 'execute'])->setMemo('监听交易漏掉v2')->setSingleton(true),
  24. // 拉取能量平台余额-并告警
  25. (new Crontab())->setName($jobpre.'getenergyplatformbalance')->setRule('*/5 * * * * *')->setCallback([App\Task\GetEnergyPlatformBalance::class, 'execute'])->setMemo('拉取能量平台余额')->setSingleton(true),
  26. // 拉取能量钱包交易-拉trx-拉usdt
  27. (new Crontab())->setName($jobpre.'energywalletinlisttrxusdt')->setRule('*/2 * * * * *')->setCallback([App\Task\GetEnergyWalletTrxUsdtTrade::class, 'execute'])->setMemo('拉取能量钱包交易')->setSingleton(true),
  28. // 能量成功通知
  29. (new Crontab())->setName($jobpre.'sendenergytgmessage')->setRule('*/2 * * * * *')->setCallback([App\Task\SendEnergyTgMessage::class, 'execute'])->setMemo('能量成功通知')->setSingleton(true),
  30. // 回收能量
  31. (new Crontab())->setName($jobpre.'recoveryenergy')->setRule('* * * * *')->setCallback([App\Task\RecoveryEnergy::class, 'execute'])->setMemo('回收能量')->setSingleton(true),
  32. // 能量下单
  33. (new Crontab())->setName($jobpre.'energyOrder')->setRule('*/2 * * * * *')->setCallback([App\Task\HandleEnergyOrder::class, 'execute'])->setMemo('能量下单')->setSingleton(true),
  34. // 开通tg会员
  35. (new Crontab())->setName($jobpre.'tgpremium')->setRule('*/3 * * * * *')->setCallback([App\Task\HandleTgPremium::class, 'execute'])->setMemo('开通tg会员')->setSingleton(true),
  36. // 取消过期未支付的订单(会员订单和充值订单)
  37. (new Crontab())->setName($jobpre.'cancelunpaidorder')->setRule('* * * * *')->setCallback([App\Task\CancelUnpaidOrder::class, 'execute'])->setMemo('取消过期未支付的订单')->setSingleton(true),
  38. // 会员成功通知
  39. (new Crontab())->setName($jobpre.'sendpremiumtgmessage')->setRule('*/2 * * * * *')->setCallback([App\Task\SendPremiumTgMessage::class, 'execute'])->setMemo('会员成功通知')->setSingleton(true),
  40. // 拉取会员钱包交易-拉usdt
  41. (new Crontab())->setName($jobpre.'premiumwalletusdttrade')->setRule('*/2 * * * * *')->setCallback([App\Task\GetPremiumWalletUsdtTrade::class, 'execute'])->setMemo('拉取会员钱包交易Usdt')->setSingleton(true),
  42. // 拉取充值钱包交易-拉usdt-拉trx
  43. (new Crontab())->setName($jobpre.'getgmswallettrxusdttrade')->setRule('*/5 * * * * *')->setCallback([App\Task\GetFmsWalletTrxUsdtTrade::class, 'execute'])->setMemo('拉取充值钱包交易')->setSingleton(true),
  44. // 拉取地址资源-智能托管-笔数套餐
  45. (new Crontab())->setName($jobpre.'getaienergywalletresource')->setRule('*/3 * * * * *')->setCallback([App\Task\GetAiEnergyWalletResource::class, 'execute'])->setMemo('拉取地址资源')->setSingleton(true),
  46. // 智能下单能量-智能托管-笔数套餐
  47. (new Crontab())->setName($jobpre.'handleaienergyorder')->setRule('*/3 * * * * *')->setCallback([App\Task\HandleAiEnergyOrder::class, 'execute'])->setMemo('智能下单能量')->setSingleton(true),
  48. // 充值订单
  49. (new Crontab())->setName($jobpre.'handlerechargeorder')->setRule('*/4 * * * * *')->setCallback([App\Task\HandleRechargeOrder::class, 'execute'])->setMemo('充值订单')->setSingleton(true),
  50. // 归集钱包
  51. (new Crontab())->setName($jobpre.'handlecollectionwallet')->setRule('*/5 * * * *')->setCallback([App\Task\HandleCollectionWallet::class, 'execute'])->setMemo('归集钱包')->setSingleton(true),
  52. ],
  53. ];