From 557823c5c1c364d2d662069d4690640654fa1267 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 15 Sep 2023 09:54:03 +0200 Subject: telegram-chat: create status files with /file/add We have no content, thus no issues with file size. --- telegram-chat.rsc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/telegram-chat.rsc b/telegram-chat.rsc index a367b78..62a6ccc 100644 --- a/telegram-chat.rsc +++ b/telegram-chat.rsc @@ -106,12 +106,12 @@ $WaitFullyConnected; :local File ("tmpfs/telegram-chat/" . [ $GetRandom20CharAlNum 6 ]); $MkDir "tmpfs/telegram-chat"; $LogPrintExit2 info $0 ("Running command from update " . $UpdateID . ": " . $Text) false; - :execute script=(":do {\n" . $Text . "\n} on-error={ :execute script=\"/\" file=" . $File . ".failed };" . \ - ":execute script=\"/\" file=" . $File . ".done") file=$File; - :if ([ $WaitForFile ($File . ".done.txt") [ $EitherOr $TelegramChatRunTime 20s ] ] = false) do={ + :execute script=(":do {\n" . $Text . "\n} on-error={ /file/add name=\"" . $File . ".failed\" };" . \ + "/file/add name=\"" . $File . ".done\"") file=$File; + :if ([ $WaitForFile ($File . ".done") [ $EitherOr $TelegramChatRunTime 20s ] ] = false) do={ :set State "The command did not finish, still running in background.\n\n"; } - :if ([ :len [ /file/find where name=($File . ".failed.txt") ] ] > 0) do={ + :if ([ :len [ /file/find where name=($File . ".failed") ] ] > 0) do={ :set State "The command failed with an error!\n\n"; } :local Content [ /file/get ($File . ".txt") contents ]; -- cgit v1.2.3-70-g09d2