diff --git a/magic.py b/magic.py index 2414f09..37f2768 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://api.ssleg.tech/v1/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)