fix
This commit is contained in:
parent
dfbc61e46f
commit
d53cd588f7
|
|
@ -30,8 +30,14 @@ async def license_index_loop(memory, platform_found: bool, seqno: int) -> [bool,
|
||||||
for user in session.query(User).filter(
|
for user in session.query(User).filter(
|
||||||
User.last_use > datetime.now() - timedelta(minutes=10)
|
User.last_use > datetime.now() - timedelta(minutes=10)
|
||||||
).all():
|
).all():
|
||||||
|
last_updated_licenses = user.meta.get('last_updated_licenses')
|
||||||
|
make_log("LicenseIndex", f"User: {user.id}, last_updated_licenses: {last_updated_licenses}", level="info")
|
||||||
|
if last_updated_licenses and (datetime.now() - datetime.fromisoformat(last_updated_licenses)) < timedelta(minutes=1):
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await user.scan_owned_user_content(session)
|
await user.scan_owned_user_content(session)
|
||||||
|
user.meta['last_updated_licenses'] = datetime.now().isoformat()
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
make_log("LicenseIndex", f"Error: {e}" + '\n' + traceback.format_exc(), level="error")
|
make_log("LicenseIndex", f"Error: {e}" + '\n' + traceback.format_exc(), level="error")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue