| 41 | } |
| 42 | |
| 43 | void GcsThrottle::SetConfig(GcsThrottleConfig config) { |
| 44 | mutex_lock l(mu_); |
| 45 | config_ = config; |
| 46 | available_tokens_ = config.initial_tokens; |
| 47 | last_updated_secs_ = env_time_->NowSeconds(); |
| 48 | } |
| 49 | |
| 50 | void GcsThrottle::UpdateState() { |
| 51 | // TODO(b/72643279): Switch to a monotonic clock. |