aboutsummaryrefslogtreecommitdiffstats
path: root/telegram-chat
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-02-26 22:00:52 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-02-26 22:19:36 +0100
commitbfd1361f7122754dfd2d30004d4effc73f375796 (patch)
treea3fbfc67905e0170815e07a3bea9b43229eaf796 /telegram-chat
parent02b447212d3b6aa238c719b34a8b245d63ca5deb (diff)
telegram-chat: get the uptime just once
Diffstat (limited to 'telegram-chat')
-rw-r--r--telegram-chat4
1 files changed, 2 insertions, 2 deletions
diff --git a/telegram-chat b/telegram-chat
index e4bd783..ba2a3ff 100644
--- a/telegram-chat
+++ b/telegram-chat
@@ -72,10 +72,10 @@ $WaitFullyConnected;
}
:local UpdateID 0;
+:local Uptime [ /system/resource/get uptime ];
:foreach Update in=[ :toarray $Data ] do={
:set UpdateID [ $JsonGetKey $Update "update_id" ];
- :if (($TelegramChatOffset->0 > 0 || [ /system/resource/get uptime ] > 5m) && \
- $UpdateID >= $TelegramChatOffset->2) do={
+ :if (($TelegramChatOffset->0 > 0 || $Uptime > 5m) && $UpdateID >= $TelegramChatOffset->2) do={
:local Trusted false;
:local Message [ $JsonGetKey $Update "message" ];
:local MessageId [ $JsonGetKey $Message "message_id" ];