소스 검색

修改发送消息提醒环境限制

kevin_zhangl 3 년 전
부모
커밋
2e805cc442
2개의 변경된 파일11개의 추가작업 그리고 11개의 파일을 삭제
  1. 1 1
      common/components/SwooleAsyncTimer.php
  2. 10 10
      common/helpers/DingTalk.php

+ 1 - 1
common/components/SwooleAsyncTimer.php

@@ -72,7 +72,7 @@ class SwooleAsyncTimer extends SwooleAsyncTimerComponent implements SocketInterf
 //            TaskFunc::initAutoBakBalance();
             // 初始化自动发送钉钉推送消息
             if (YII_ENV == YII_ENV_PROD) {
-                TaskFunc::initAutoSendDingTalk();
+//                TaskFunc::initAutoSendDingTalk();
             }
         }
     }

+ 10 - 10
common/helpers/DingTalk.php

@@ -38,15 +38,15 @@ class DingTalk
         ];
 
         // 正式环境才发送
-        if (YII_ENV == YII_ENV_PROD) {
-            $result = self::request_by_curl(json_encode($data));
-            if ($result['errcode'] > 0) {
-                // 重新推送一次,如果失败,写错误日志
-                $result = self::request_by_curl(json_encode($data));
-                if (!$result['errcode']) {
-                    LoggerTool::error([$result, $message]);
-                }
-            }
-        }
+//        if (YII_ENV == YII_ENV_PROD) {
+//            $result = self::request_by_curl(json_encode($data));
+//            if ($result['errcode'] > 0) {
+//                // 重新推送一次,如果失败,写错误日志
+//                $result = self::request_by_curl(json_encode($data));
+//                if (!$result['errcode']) {
+//                    LoggerTool::error([$result, $message]);
+//                }
+//            }
+//        }
     }
 }