A clone answered from the pack cache is served before the free operation cap: it is not an operation
1 file+8−60/1 viewed
| 1558 | 1558 | } | |
| 1559 | 1559 | }; | |
| 1560 | 1560 | timing.mark("kept"); | |
| 1561 | − | if let Some((response, status, message)) = limited? { | |
| 1562 | − | after.ended(status, Some(message.to_owned())); | |
| 1563 | − | after.spawn(env, ctx); | |
| 1564 | − | return Ok(response); | |
| 1565 | − | } | |
| 1561 | + | // A kept pack first: it never reaches the store, so it is never an | |
| 1562 | + | // operation, and a free workspace past its operation cap still gets | |
| 1563 | + | // it. (The other limits are a push's, and a pack is only a fetch.) | |
| 1566 | 1564 | if let Some(kept) = pack { | |
| 1567 | 1565 | timing.note("pack", "hit"); | |
| 1568 | − | // Never reached the store: never an operation. | |
| 1569 | 1566 | let sent = body.as_ref().map_or(0, |body| body.len() as u64); | |
| 1570 | 1567 | meters::record(pack_cache::HIT, &key, sent, kept.size); | |
| 1571 | 1568 | after.ended(200, None); | |
| 1572 | 1569 | after.spawn(env, ctx); | |
| 1573 | 1570 | return kept.response(); | |
| 1574 | 1571 | } | |
| 1572 | + | if let Some((response, status, message)) = limited? { | |
| 1573 | + | after.ended(status, Some(message.to_owned())); | |
| 1574 | + | after.spawn(env, ctx); | |
| 1575 | + | return Ok(response); | |
| 1576 | + | } | |
| 1575 | 1577 | if pack_key.is_some() { | |
| 1576 | 1578 | timing.note("pack", "miss"); | |
| 1577 | 1579 | } |