push采用try避免失败导致程序崩溃
This commit is contained in:
parent
5c72d169d5
commit
1e2b50cbdb
50
server.py
50
server.py
@ -68,28 +68,34 @@ def s2wx(title="",description="", content=""):
|
||||
logger.debug("msgpusher {}",res)
|
||||
except:
|
||||
logger.error("msgpusher error");
|
||||
res = requests.post("http://106.52.193.182:10004/message?token=AK9uikNvF7HxlGG", json={
|
||||
"title": title,
|
||||
"description": description,
|
||||
"message": c,
|
||||
"extras": {
|
||||
"client::display": {
|
||||
"contentType": "text/markdown"
|
||||
}}
|
||||
})
|
||||
logger.debug("Gotify {}",res)
|
||||
return
|
||||
# res = requests.post("http://106.52.193.182:10004/message?token=AK9uikNvF7HxlGG", json={
|
||||
res = requests.post("http://127.0.0.1:10004/message?token=AQNbWzNcL.DB.hP", json={
|
||||
"title": title,
|
||||
"description": description,
|
||||
"message": c,
|
||||
"extras": {
|
||||
"client::display": {
|
||||
"contentType": "text/markdown"
|
||||
}}
|
||||
})
|
||||
logger.debug("Gotify {}",res)
|
||||
try:
|
||||
res = requests.post("http://106.52.193.182:10004/message?token=AK9uikNvF7HxlGG", json={
|
||||
"title": title,
|
||||
"description": description,
|
||||
"message": c,
|
||||
"extras": {
|
||||
"client::display": {
|
||||
"contentType": "text/markdown"
|
||||
}}
|
||||
})
|
||||
logger.debug("Gotify {}",res)
|
||||
except:
|
||||
logger.error("Gotify error");
|
||||
try:
|
||||
# res = requests.post("http://106.52.193.182:10004/message?token=AK9uikNvF7HxlGG", json={
|
||||
res = requests.post("http://127.0.0.1:10004/message?token=AQNbWzNcL.DB.hP", json={
|
||||
"title": title,
|
||||
"description": description,
|
||||
"message": c,
|
||||
"extras": {
|
||||
"client::display": {
|
||||
"contentType": "text/markdown"
|
||||
}}
|
||||
})
|
||||
logger.debug("Gotify {}",res)
|
||||
except:
|
||||
logger.error("Gotify (127.0.0.1) error");
|
||||
|
||||
# try:
|
||||
# try:
|
||||
# res = res.json()
|
||||
|
Loading…
Reference in New Issue
Block a user