test(vector-sync): close round-8 coverage gaps (500 path, non-string list)
- route test for purge_doc_types raising on total failure -> 500 - route test for doc_types list containing non-strings -> 400 - reword the capabilities move_to_end comment (no-op on new keys; needed only for the expired-key in-place update) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
ea53ed9ce0
commit
7067c5fff1
@@ -100,8 +100,9 @@ async def allowed_doc_types(
|
||||
|
||||
result = _parse_enabled_doc_types(payload)
|
||||
_cache[user_id] = (now, result)
|
||||
# New key: __setitem__ already appends (no-op). Existing expired key: the
|
||||
# update keeps its old position, so move it to the end to preserve LRU order.
|
||||
# Needed only for an existing (expired) key: __setitem__ updates it in place,
|
||||
# keeping its old position, so move it to the end to preserve LRU order. For
|
||||
# a brand-new key __setitem__ already appends, so this is a harmless no-op.
|
||||
_cache.move_to_end(user_id)
|
||||
while len(_cache) > _CACHE_MAXSIZE:
|
||||
_cache.popitem(last=False) # evict least-recently-used
|
||||
|
||||
Reference in New Issue
Block a user