Fix Upload Items (#682)

* Fix Upload Items

* Remove debugger

* Switch to bulk APIs

* Address TODO

Co-authored-by: Jordi Bunster <jbunster@microsoft.com>
This commit is contained in:
Steve Faulkner
2021-04-15 18:25:43 -05:00
committed by GitHub
parent f94f95e788
commit 3f8e394952
14 changed files with 174 additions and 370 deletions

View File

@@ -75,7 +75,10 @@ export async function getTokenFromAuthService(verb: string, resourceType: string
}
}
let _client: Cosmos.CosmosClient;
export function client(): Cosmos.CosmosClient {
if (_client) return _client;
const options: Cosmos.CosmosClientOptions = {
endpoint: endpoint() || "https://cosmos.azure.com", // CosmosClient gets upset if we pass a bad URL. This should never actually get called
key: userContext.masterKey,
@@ -89,5 +92,6 @@ export function client(): Cosmos.CosmosClient {
if (configContext.PROXY_PATH !== undefined) {
(options as any).plugins = [{ on: "request", plugin: requestPlugin }];
}
return new Cosmos.CosmosClient(options);
_client = new Cosmos.CosmosClient(options);
return _client;
}