12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace app\index\controller;
- use think\Exception;
- use think\exception\ErrorException;
- use think\Queue;
- class PushJob
- {
-
- public static function actionWithDoPinkJob(array $data){
- try{
-
-
- $jobHandlerClassName = 'app\index\job\PullDoPink';
-
- $jobQueueName = "doPinkJobQueue";
-
-
- $jobData = [ 'pinkInfo' => $data, 'time' => date('Y-m-d H:i:s')] ;
- if (!isset($data['pink_time']) || !$data['pink_time']) return true;
- $timewait = $data['pink_time'] + 300;
-
-
-
- $isPushed = Queue::later($timewait, $jobHandlerClassName , $jobData , $jobQueueName );
-
-
- if( $isPushed !== false ){
- return 1;
- }else{
- return 1;
- }
- }catch (ErrorException $e){
- echo $e->getMessage();
- }
- }
- }
|