Skip to content

Commit

Permalink
fix clear_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
feihoo87 committed Jul 18, 2024
1 parent 7adbe3a commit f01b1a3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions qulab/scan/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,15 @@ def clear_cache():
return

logger.debug(f"clear_cache record_cache: {len(record_cache)}")
for k, (t, _) in zip(sorted(record_cache.items(), key=lambda x: x[1][0]),
range(len(record_cache) - CACHE_SIZE)):
for (k, (t, r),
i) in zip(sorted(record_cache.items(), key=lambda x: x[1][0]),
range(len(record_cache) - CACHE_SIZE)):
del record_cache[k]

logger.debug(f"clear_cache buffer_list_cache: {len(buffer_list_cache)}")
for k, (t,
_) in zip(sorted(buffer_list_cache.items(), key=lambda x: x[1][0]),
range(len(buffer_list_cache) - CACHE_SIZE)):
for (k, (t, r),
i) in zip(sorted(buffer_list_cache.items(), key=lambda x: x[1][0]),
range(len(buffer_list_cache) - CACHE_SIZE)):
del buffer_list_cache[k]
logger.debug(f"clear_cache done.")

Expand Down

0 comments on commit f01b1a3

Please sign in to comment.