From 467c3bedece431185c1e57bf38ca6dfe089d197c Mon Sep 17 00:00:00 2001 From: rsgrinko Date: Fri, 8 Jul 2022 15:59:42 +0300 Subject: [PATCH] =?UTF-8?q?[*]=20MQ=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=D0=B5=20=D0=BB=D0=BE=D0=B3=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/bootstrap.php | 9 ++++++++- core/lib/Core/Models/MQ.class.php | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/bootstrap.php b/core/bootstrap.php index 8dd70c1..4daa2ec 100644 --- a/core/bootstrap.php +++ b/core/bootstrap.php @@ -105,11 +105,18 @@ } // debug - function sendTelegram(?string $message): void + function sendTelegram(?string $message, ?string $file = null): void { (new \Core\ExternalServices\TelegramSender(TELEGRAM_BOT_TOKEN)) ->setChat(TELEGRAM_NOTIFICATION_CHANNEL) ->sendMessage($message); + + if(!empty($file)) { + (new \Core\ExternalServices\TelegramSender(TELEGRAM_BOT_TOKEN)) + ->setChat(TELEGRAM_NOTIFICATION_CHANNEL) + ->sendDocument($file); + } + } //end debug diff --git a/core/lib/Core/Models/MQ.class.php b/core/lib/Core/Models/MQ.class.php index 8ce99f7..1538b25 100644 --- a/core/lib/Core/Models/MQ.class.php +++ b/core/lib/Core/Models/MQ.class.php @@ -727,6 +727,8 @@ ) . ')' ); + sendTelegram('Задания были возвращены в работу (' . count($arStuckTasks) . ' шт)' . PHP_EOL . implode(', ', $arStuckTasks)); + Log::logToFile( 'Задания были возвращены в работу (' . count($arStuckTasks) . ')', self::LOG_FILE,