Финальное обновление на v4.27

master
anton 2023-06-27 09:59:24 +03:00
parent 9c315d6f35
commit 6c0a876865
Signed by: anton
GPG Key ID: 50F7E97F96C07ECF
1 changed files with 10 additions and 6 deletions

View File

@ -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)