🐛 fix: rate.py variable scope

dafuq
This commit is contained in:
一只瓜 2021-04-21 18:44:42 +08:00 committed by GitHub
parent 0004a274c7
commit cf36a42328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,10 +41,10 @@ last_init = time.time()
@listener(incoming=True, ignore_edited=True) @listener(incoming=True, ignore_edited=True)
async def refresher(context): async def refresher(context):
global last_init
if time.time() - last_init > 24 * 60 * 60: if time.time() - last_init > 24 * 60 * 60:
# we'd better do this to prevent ruining the log file with massive fail logs # we'd better do this to prevent ruining the log file with massive fail logs
# as this `refresher` would be called frequently # as this `refresher` would be called frequently
global last_init
last_init = time.time() last_init = time.time()
try: try:
init() init()