feat: do not send notification when notify token is empty
This commit is contained in:
@@ -170,6 +170,10 @@ fn keep_runningd(keep_running_config: Arc<KeepRunningConfig>) {
|
||||
}
|
||||
|
||||
async fn send_notify(notify_token: &str, text: &str) {
|
||||
if notify_token.is_empty() {
|
||||
info!("Notify token is empty, do not send DingTalk notification");
|
||||
return;
|
||||
}
|
||||
match DingTalk::from_token(¬ify_token) {
|
||||
Err(err) => error!("Prepare DingTalk error: {}", err),
|
||||
Ok(dt) => if let Err(err) = dt.send_text(text).await {
|
||||
|
||||
Reference in New Issue
Block a user