fix(cache): remove redundant source comments

This commit is contained in:
Yujong Lee 2026-09-21 11:23:47 -07:00
parent 1b6b704ddd
commit 22995d1575
5 changed files with 0 additions and 14 deletions

View file

@ -228,7 +228,6 @@ where
.get(key)
.filter(|existing| eligible.is_empty() || eligible.contains(existing))
.cloned();
// Matches the Redis claim: an unconditional claim only extends its own winner.
if let Some(existing) = &existing
&& eligible.is_empty()
&& *existing != candidate

View file

@ -57,8 +57,6 @@ const INCREMENT_SCRIPT: &str = concat!(
"redis.call('EXPIRE', KEYS[1], ARGV[2]); end; return value"
);
// Compare-and-set against the exact bytes the claim decision was made on.
// ARGV: [1] expected payload or "" when absent, [2] ttl, [3] new payload, [4] refresh ttl.
const CLAIM_SCRIPT: &str = concat!(
"local current = redis.call('GET', KEYS[1]); ",
"if ARGV[1] == '' then if current ~= false and current ~= '' then return 0; end; ",

View file

@ -5,7 +5,6 @@ use serde_json::Value;
use crate::{CacheEntry, ResponseCache, ResponseCacheRequest};
/// Defers async writes until `flush_size` entries are pending, then stores them as one batch.
pub struct WriteBuffer {
flush_size: usize,
entries: Mutex<Vec<(ResponseCacheRequest, Value, Duration)>>,

View file

@ -125,8 +125,6 @@ impl ResolvedCache {
}
}
/// Native bindings return `{values, missing_indices}`, while a Python callback returns the
/// list of its per-request results.
#[pyo3(signature = (requests, *, callback_kwargs=None))]
fn lookup_batch(
&self,
@ -222,7 +220,6 @@ impl ResolvedCache {
}
}
/// A Python callback receives the caller's original result through `callback_result`.
#[pyo3(signature = (requests, responses, *, callback_result=None, callback_kwargs=None))]
fn async_store_batch<'py>(
&self,

View file

@ -7,8 +7,6 @@ use pyo3::{
use super::future::ready_none;
/// A custom Python cache object, driven through the built-in `Cache` API so a `Cache` subclass
/// works unchanged.
pub(super) struct PythonCallback(Py<PyAny>);
impl PythonCallback {
@ -61,8 +59,6 @@ impl PythonCallback {
)
}
/// The built-in `Cache` API has no batch read, so the callback receives one
/// `get_cache(**kwargs)` call per request, in order, and the results come back as a list.
pub(super) fn lookup_batch<'py>(
&self,
py: Python<'py>,
@ -98,8 +94,6 @@ impl PythonCallback {
.call_method1("gather", PyTuple::new(py, awaitables)?)
}
/// Receives the caller's original result, because the built-in
/// `Cache.async_add_cache_pipeline` splits the batch itself.
pub(super) fn async_store_batch<'py>(
&self,
py: Python<'py>,
@ -116,7 +110,6 @@ impl PythonCallback {
)
}
/// The built-in `Cache` facade has no flush of its own; its backend does.
pub(super) fn async_flush<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> {
let object = self.0.bind(py);
let backend = match object.getattr_opt("cache")? {