Skip to content

Instantly share code, notes, and snippets.

@zleao
Last active July 14, 2020 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zleao/4f75bf7618f503f6f64041a3fc287900 to your computer and use it in GitHub Desktop.
Save zleao/4f75bf7618f503f6f64041a3fc287900 to your computer and use it in GitHub Desktop.
Scale down the shared throughput of a database
...
//Get CollectionCount
...
var offer = documentClient.CreateOfferQuery().Where(r => r.ResourceLink == database.SelfLink).ToList().FirstOrDefault();
if(offer != null)
{
offer = new OfferV2(offer, Math.Max(400, (collectionCount * 100)));
await documentClient.ReplaceOfferAsync(offer);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment