From 46a903939d19ea1d2922db9ac213f611d6d6955f Mon Sep 17 00:00:00 2001 From: anton <1537206@mail.ru> Date: Tue, 27 Jun 2023 09:59:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BD=D0=B0=D0=BB=D1=8C=D0=BD?= =?UTF-8?q?=D0=BE=D0=B5=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BD=D0=B0=20v4.27?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- magic.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/magic.py b/magic.py index 2414f09..c058d8e 100644 --- a/magic.py +++ b/magic.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 -# Magic wand v4.25 -# 26/09/2021 -# https://t.me/ssleg © 2020 – 2021 +# Magic wand v4.27 +# 27/06/2023 +# https://t.me/ssleg © 2020 – 2023 import logging import signal @@ -194,7 +194,7 @@ def stat_upload(): 'Content-Type': 'application/json; charset=utf-8' } # noinspection HttpUrlsUsage - stat_upload_url = 'http://188.124.50.148/stat_up' + stat_upload_url = 'https://ssleg.tech/stat_up' hash_md5 = md5(bot_key.encode()) request_json = {'protocol_version': '1.1', 'application': 'Magic Wand', 'app_version': get_my_version(), 'uptime': get_up_seconds(), 'errors': error_count.get(), 'fingerprint': hash_md5.hexdigest()} @@ -269,11 +269,15 @@ def log_watcher(): filesize = path.getsize(logfile_name) if filesize > log_size: log_size.set(filesize) - client.loop.call_soon(log_reader) + log_reader() + + if filesize < log_size: + log_size.clear() + last_string.clear() if bot_stats: if get_up_seconds() > next_stat: - client.loop.call_soon(stat_upload) + stat_upload() client.loop.call_later(60, log_watcher)