refactor: loop when monitorInfo.tags exist

This commit is contained in:
guguji5 2023-09-05 14:05:44 +08:00
parent 7557073619
commit f8495a970b

View file

@ -63,8 +63,10 @@ class FlashDuty extends NotificationProvider {
resource: this.genMonitorUrl(monitorInfo),
check: monitorInfo.name,
};
for (let tag of monitorInfo.tags) {
labels[tag.name] = tag.value;
if (monitorInfo.tags && monitorInfo.tags.length > 0) {
for (let tag of monitorInfo.tags) {
labels[tag.name] = tag.value;
}
}
const options = {
method: "POST",