fix some comments

Signed-off-by: battmdpkq <cmaker@163.com>
Replicated-from: https://github.com/cloudflare/pingora/pull/123
Includes-commit: 943bedb281
This commit is contained in:
battmdpkq 2024-03-08 02:52:27 +00:00 committed by Edward Wang
parent 8963575ed2
commit 8a84b24ad0
5 changed files with 6 additions and 6 deletions

2
.bleep
View file

@ -1 +1 @@
c3ec53f03ed27ce7ce90ec76e9ae67bab2097fd3 deb3c5409e938ec9c7d0da9b7a2d331eabbb2cd5

View file

@ -211,7 +211,7 @@ impl HandleHit for MemHitHandler {
pub struct MemMissHandler { pub struct MemMissHandler {
body: Arc<RwLock<Vec<u8>>>, body: Arc<RwLock<Vec<u8>>>,
bytes_written: Arc<watch::Sender<PartialState>>, bytes_written: Arc<watch::Sender<PartialState>>,
// these are used only in finish() to to data from temp to cache // these are used only in finish() to data from temp to cache
key: String, key: String,
cache: Arc<RwLock<HashMap<String, CacheObject>>>, cache: Arc<RwLock<HashMap<String, CacheObject>>>,
temp: Arc<RwLock<HashMap<String, TempObject>>>, temp: Arc<RwLock<HashMap<String, TempObject>>>,

View file

@ -34,7 +34,7 @@ pub trait HealthCheck {
/// This function defines how many *consecutive* checks should flip the health of a backend. /// This function defines how many *consecutive* checks should flip the health of a backend.
/// ///
/// For example: with `success``: `true`: this function should return the /// For example: with `success``: `true`: this function should return the
/// number of check need to to flip from unhealthy to healthy. /// number of check need to flip from unhealthy to healthy.
fn health_threshold(&self, success: bool) -> usize; fn health_threshold(&self, success: bool) -> usize;
} }

View file

@ -85,7 +85,7 @@ impl<SV> HttpProxy<SV> {
if let Some((mut meta, handler)) = res { if let Some((mut meta, handler)) = res {
// vary logic // vary logic
// because this branch can be called multiple times in a loop, and we only // because this branch can be called multiple times in a loop, and we only
// need to to update the vary once, check if variance is already set to // need to update the vary once, check if variance is already set to
// prevent unnecessary vary lookups // prevent unnecessary vary lookups
let cache_key = session.cache.cache_key(); let cache_key = session.cache.cache_key();
if let Some(variance) = cache_key.variance_bin() { if let Some(variance) = cache_key.variance_bin() {

View file

@ -18,7 +18,7 @@ use pingora_cache::{key::HashBinary, CacheKey, CacheMeta, RespCacheable, RespCac
/// The interface to control the HTTP proxy /// The interface to control the HTTP proxy
/// ///
/// The methods in [ProxyHttp] are filters/callbacks which will be performed on all requests at their /// The methods in [ProxyHttp] are filters/callbacks which will be performed on all requests at their
/// paticular stage (if applicable). /// particular stage (if applicable).
/// ///
/// If any of the filters returns [Result::Err], the request will fail and the error will be logged. /// If any of the filters returns [Result::Err], the request will fail and the error will be logged.
#[cfg_attr(not(doc_async_trait), async_trait)] #[cfg_attr(not(doc_async_trait), async_trait)]
@ -264,7 +264,7 @@ pub trait ProxyHttp {
/// ///
/// If the error can be retried, [Self::upstream_peer()] will be called again so that the user /// If the error can be retried, [Self::upstream_peer()] will be called again so that the user
/// can decide whether to send the request to the same upstream or another upstream that is possibly /// can decide whether to send the request to the same upstream or another upstream that is possibly
/// avaliable. /// available.
fn fail_to_connect( fn fail_to_connect(
&self, &self,
_session: &mut Session, _session: &mut Session,