mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Attempt to fix clock issues when running on AWS Lambda
This commit is contained in:
parent
71bdfe6c40
commit
15bdb3de4f
@ -24,7 +24,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class MsgId:
|
class MsgId:
|
||||||
reference_clock = perf_counter()
|
reference_clock = 0
|
||||||
last_time = 0
|
last_time = 0
|
||||||
msg_id_offset = 0
|
msg_id_offset = 0
|
||||||
server_time = 0
|
server_time = 0
|
||||||
@ -40,5 +40,6 @@ class MsgId:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def set_server_time(cls, server_time: int):
|
def set_server_time(cls, server_time: int):
|
||||||
if not cls.server_time:
|
if not cls.server_time:
|
||||||
|
cls.reference_clock = perf_counter()
|
||||||
cls.server_time = server_time
|
cls.server_time = server_time
|
||||||
log.info(f"Time synced: {datetime.utcfromtimestamp(server_time)} UTC")
|
log.info(f"Time synced: {datetime.utcfromtimestamp(server_time)} UTC")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user