update DB

fix: scanner - invalid cache expiration logic
This commit is contained in:
Dr.Lt.Data
2024-04-03 20:30:56 +09:00
parent c35d494af5
commit 3151cc96ff
7 changed files with 375 additions and 246 deletions

View File

@@ -275,8 +275,9 @@ def update_custom_nodes():
# renew outdated cache
outdated_urls = []
for k, v in github_stats.items():
if (datetime.datetime.now().timestamp() - v['cached_time']) > 60*60*3: # 3 hours
outdated_urls += k
elapsed = (datetime.datetime.now().timestamp() - v['cached_time'])
if elapsed > 60*60*12: # 12 hours
outdated_urls.append(k)
for url in outdated_urls:
renew_stat(url)