G-XD commented on code in PR #3761:
URL: 
https://github.com/apache/incubator-opendal/pull/3761#discussion_r1428081064


##########
core/src/layers/throttle.rs:
##########
@@ -221,24 +220,22 @@ impl<R: oio::Write> oio::Write for ThrottleWrapper<R> {
 
         loop {
             match self.limiter.check_n(buf_length) {
-                Ok(_) => return self.inner.poll_write(cx, bs),
-                Err(negative) => match negative {
+                Ok(res) => match res {

Review Comment:
   Sorry for my mistake. In `governor` 0.6.0, the return value type of the 
`RateLimiter::check_n` was updated from [Result<MW::PositiveOutcome, 
NegativeMultiDecision\<MW::NegativeOutcome>>](https://docs.rs/governor/latest/governor/struct.RateLimiter.html#method.check_n)
 to [Result<Result<MW::PositiveOutcome, MW::NegativeOutcome>, 
InsufficientCapacity>](https://docs.rs/governor/0.5.1/governor/struct.RateLimiter.html#method.check_n).
 
   
   When `Failure (but ok): Not all cells can make it through at the current 
time` occurred:
   
   - Version 0.5.x returned 
[Err(NegativeMultiDecision::BatchNonConforming)](https://docs.rs/governor/0.5.1/governor/enum.NegativeMultiDecision.html#)
 .
   - Version 0.6.0 now returns `Ok<Err(NotUntil)>`. 
   
   Therefore, I modified the return value handling of the `check_n` function.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to