aboutsummaryrefslogtreecommitdiffstats
path: root/mod/notification-ntfy.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-08 17:32:12 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-03-12 20:37:57 +0100
commitba2df80f073caf6b426def177b217d1b37954d7f (patch)
tree5dadd74e56ded840e62e82127a9315c8769bfd83 /mod/notification-ntfy.rsc
parent19802c0b6977f9467fada4ace3cab017dd98964b (diff)
parent242ecef012f5208b6fa088a1222d0d5477e5b2ed (diff)
Merge branch 'LogPrint' into next
Diffstat (limited to 'mod/notification-ntfy.rsc')
-rw-r--r--mod/notification-ntfy.rsc15
1 files changed, 8 insertions, 7 deletions
diff --git a/mod/notification-ntfy.rsc b/mod/notification-ntfy.rsc
index 4dc6d84..6d48a59 100644
--- a/mod/notification-ntfy.rsc
+++ b/mod/notification-ntfy.rsc
@@ -18,10 +18,10 @@
:global NtfyMessageIDs;
:global IsFullyConnected;
- :global LogPrintExit2;
+ :global LogPrint;
:if ([ $IsFullyConnected ] = false) do={
- $LogPrintExit2 debug $0 ("System is not fully connected, not flushing.") false;
+ $LogPrint debug $0 ("System is not fully connected, not flushing.");
:return false;
}
@@ -29,7 +29,7 @@
:local QueueLen [ :len $NtfyQueue ];
:if ([ :len [ /system/scheduler/find where name="_FlushNtfyQueue" ] ] > 0 && $QueueLen = 0) do={
- $LogPrintExit2 warning $0 ("Flushing Ntfy messages from scheduler, but queue is empty.") false;
+ $LogPrint warning $0 ("Flushing Ntfy messages from scheduler, but queue is empty.");
}
:foreach Id,Message in=$NtfyQueue do={
@@ -39,7 +39,7 @@
($Message->"url") http-header-field=($Message->"headers") http-data=($Message->"text") as-value;
:set ($NtfyQueue->$Id);
} on-error={
- $LogPrintExit2 debug $0 ("Sending queued Ntfy message failed.") false;
+ $LogPrint debug $0 ("Sending queued Ntfy message failed.");
:set AllDone false;
}
}
@@ -66,7 +66,7 @@
:global CertificateAvailable;
:global EitherOr;
:global IfThenElse;
- :global LogPrintExit2;
+ :global LogPrint;
:global SymbolForNotification;
:global UrlEncode;
@@ -88,13 +88,14 @@
:do {
:if ($NtfyServer = "ntfy.sh") do={
:if ([ $CertificateAvailable "R3" ] = false) do={
- $LogPrintExit2 warning $0 ("Downloading required certificate failed.") true;
+ $LogPrint warning $0 ("Downloading required certificate failed.");
+ :error false;
}
}
/tool/fetch check-certificate=yes-without-crl output=none http-method=post \
$Url http-header-field=$Headers http-data=$Text as-value;
} on-error={
- $LogPrintExit2 info $0 ("Failed sending ntfy notification! Queuing...") false;
+ $LogPrint info $0 ("Failed sending ntfy notification! Queuing...");
:if ([ :typeof $NtfyQueue ] = "nothing") do={
:set NtfyQueue ({});