优化
This commit is contained in:
@@ -23,13 +23,14 @@ def send_dingding_alert(context):
|
|||||||
},
|
},
|
||||||
"at": {"isAtAll": True}
|
"at": {"isAtAll": True}
|
||||||
}
|
}
|
||||||
|
print(message)
|
||||||
http_hook = HttpHook(method="POST", http_conn_id="dingding_webhook")
|
http_hook = HttpHook(method="POST", http_conn_id="dingding_webhook")
|
||||||
http_hook.run(
|
http_hook.run(
|
||||||
endpoint="robot/send",
|
endpoint="robot/send",
|
||||||
data=json.dumps(message),
|
data=json.dumps(message),
|
||||||
headers={"Content-Type": "application/json"}
|
headers={"Content-Type": "application/json"}
|
||||||
)
|
)
|
||||||
|
print("success")
|
||||||
|
|
||||||
def fail_task():
|
def fail_task():
|
||||||
raise ValueError("This task is designed to fail")
|
raise ValueError("This task is designed to fail")
|
||||||
|
|||||||
Reference in New Issue
Block a user