mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-21 22:28:04 +00:00
🔖 Update to v1.4.13
This commit is contained in:
parent
e49471aa6c
commit
020dc1c4a8
@ -22,8 +22,8 @@ from pagermaid.scheduler import scheduler
|
|||||||
import pyromod.listen
|
import pyromod.listen
|
||||||
from pyrogram import Client
|
from pyrogram import Client
|
||||||
|
|
||||||
pgm_version = "1.4.12"
|
pgm_version = "1.4.13"
|
||||||
pgm_version_code = 1412
|
pgm_version_code = 1413
|
||||||
CMD_LIST = {}
|
CMD_LIST = {}
|
||||||
module_dir = __path__[0]
|
module_dir = __path__[0]
|
||||||
working_dir = getcwd()
|
working_dir = getcwd()
|
||||||
|
@ -28,7 +28,8 @@ async def clear_read_context_cron():
|
|||||||
|
|
||||||
@scheduler.scheduled_job("interval", seconds=10, id="reload.ping_watchdog")
|
@scheduler.scheduled_job("interval", seconds=10, id="reload.ping_watchdog")
|
||||||
async def ping_task():
|
async def ping_task():
|
||||||
if not bot.is_initialized:
|
if not bot.session.is_started.is_set():
|
||||||
|
logs.debug("Ping task bot not started, skip")
|
||||||
return
|
return
|
||||||
if ping_watchdog_event.is_set():
|
if ping_watchdog_event.is_set():
|
||||||
logs.debug("Ping task watchdog event set, skip")
|
logs.debug("Ping task watchdog event set, skip")
|
||||||
@ -46,8 +47,7 @@ async def ping_task():
|
|||||||
logs.debug("Ping task raise OSError, try restart")
|
logs.debug("Ping task raise OSError, try restart")
|
||||||
ping_watchdog_event.set()
|
ping_watchdog_event.set()
|
||||||
try:
|
try:
|
||||||
await bot.restart()
|
await bot.session.restart()
|
||||||
await reload_all()
|
|
||||||
finally:
|
finally:
|
||||||
ping_watchdog_event.clear()
|
ping_watchdog_event.clear()
|
||||||
logs.debug("Ping task ok")
|
logs.debug("Ping task ok")
|
||||||
|
Loading…
Reference in New Issue
Block a user