mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 01:41:31 +00:00
Quick demo of using another client for some read operations. Other read operations still cause error when primary region is blocked. HPM proxying for local dev still looks to work ok. Still need to add ability to swap out endpoints in the regional endpoint.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { FeedOptions, ItemDefinition, QueryIterator, Resource } from "@azure/cosmos";
|
||||
import { LocalStorageUtility, StorageKey } from "../../Shared/StorageUtility";
|
||||
import { Queries } from "../Constants";
|
||||
import { client } from "../CosmosClient";
|
||||
import { client2 } from "../ReadRegionCosmosClient";
|
||||
// import { client } from "../CosmosClient";
|
||||
|
||||
export const queryDocuments = (
|
||||
databaseId: string,
|
||||
@@ -10,7 +11,9 @@ export const queryDocuments = (
|
||||
options: FeedOptions,
|
||||
): QueryIterator<ItemDefinition & Resource> => {
|
||||
options = getCommonQueryOptions(options);
|
||||
return client().database(databaseId).container(containerId).items.query(query, options);
|
||||
console.log(`${JSON.stringify(client2().getReadEndpoint())}`);
|
||||
return client2().database(databaseId).container(containerId).items.query(query, options);
|
||||
// return client().database(databaseId).container(containerId).items.query(query, options);
|
||||
};
|
||||
|
||||
export const getCommonQueryOptions = (options: FeedOptions): FeedOptions => {
|
||||
|
||||
Reference in New Issue
Block a user