初始化仓库

This commit is contained in:
2024-09-19 11:32:39 +08:00
commit 8f5315e936
921 changed files with 76455 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace common\jobs;
use common\services\ImService;
use yii\queue\Queue;
use yii\queue\RetryableJobInterface;
//避免消息发送影响正常逻辑,所有的消息发送单独挪动出来
class MessageSendJob extends BaseJob implements RetryableJobInterface
{
public $ims_id;
public $to_id;
public $to_role;
public $content;
/**
* @param Queue $queue which pushed and is handling the job
*/
public function execute($queue)
{
ImService::getInstance()->sendToUid($this->ims_id,$this->to_id,$this->to_role,$this->content);
}
public function getTtr()
{
return 60;
}
public function canRetry($attempt, $error)
{
return ($attempt < 5) && ($error instanceof \Exception);
}
}