Browse Source

修改sql

李莎 1 year ago
parent
commit
3c5fd4c1f4
1 changed files with 8 additions and 9 deletions
  1. 8 9
      main.py

+ 8 - 9
main.py

@@ -75,13 +75,12 @@ while True:
         # 关闭数据库
         mysql_cur.close()
         conn.close()
-            #
-        # if messages:
-        #     print("%s 发送钉钉报警" % datetime_now())
-        #     messages.append("<font color=#0080FF>详情查看MySQL数据库sagacloud_setup里的space_meet_set表</font>")
-        #     messages_info = "\n".join(messages)
-        #     # 如果有报警,发送钉钉
-        #     title = "## **【四川大厦】会议室未绑定空间报警** "
-        #     messages_info = title + "\n" + "___" + "\n" + messages_info
-        #     send_message_markdown(title, messages_info, dingding)
+        if messages:
+            print("%s 发送钉钉报警" % datetime_now())
+            messages.append("<font color=#0080FF>详情查看MySQL数据库sagacloud_setup里的space_meet_set表</font>")
+            messages_info = "\n".join(messages)
+            # 如果有报警,发送钉钉
+            title = "## **【四川大厦】会议室未绑定空间报警** "
+            messages_info = title + "\n" + "___" + "\n" + messages_info
+            send_message_markdown(title, messages_info, dingding)
         time.sleep(2)