mirror of
https://github.com/google/nomulus.git
synced 2025-05-17 17:59:41 +02:00
Inject RateLimiter in CloudDnsWriter
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=136055927
This commit is contained in:
parent
70afce13fe
commit
7b9ce8e087
4 changed files with 17 additions and 6 deletions
|
@ -20,6 +20,7 @@ import com.google.api.client.json.JsonFactory;
|
|||
import com.google.api.services.dns.Dns;
|
||||
import com.google.api.services.dns.DnsScopes;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.util.concurrent.RateLimiter;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import dagger.multibindings.IntoMap;
|
||||
|
@ -58,4 +59,13 @@ public final class CloudDnsModule {
|
|||
static String provideWriterName() {
|
||||
return CloudDnsWriter.NAME;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Named("cloudDns")
|
||||
static RateLimiter provideRateLimiter() {
|
||||
// This is the default max QPS for Cloud DNS. It can be increased by contacting the team
|
||||
// via the Quotas page on the Cloud Console.
|
||||
int cloudDnsMaxQps = 20;
|
||||
return RateLimiter.create(cloudDnsMaxQps);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue