mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-04-22 01:24:21 +01:00
Added extra logging for mongo index update RP call (#303)
* Added extra logging * changes error -> error.message in traceFailure
This commit is contained in:
parent
4bee46ce55
commit
542abf4d3a
@ -230,6 +230,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
if (
|
if (
|
||||||
this.container.isMongoIndexEditorEnabled() &&
|
this.container.isMongoIndexEditorEnabled() &&
|
||||||
this.container.isPreferredApiMongoDB() &&
|
this.container.isPreferredApiMongoDB() &&
|
||||||
|
this.container.isEnableMongoCapabilityPresent() &&
|
||||||
this.container.databaseAccount()
|
this.container.databaseAccount()
|
||||||
) {
|
) {
|
||||||
await this.refreshIndexTransformationProgress();
|
await this.refreshIndexTransformationProgress();
|
||||||
@ -395,11 +396,13 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.state.isMongoIndexingPolicySaveable && this.mongoDBCollectionResource) {
|
if (this.state.isMongoIndexingPolicySaveable && this.mongoDBCollectionResource) {
|
||||||
|
try {
|
||||||
const newMongoIndexes = this.getMongoIndexesToSave();
|
const newMongoIndexes = this.getMongoIndexesToSave();
|
||||||
const newMongoCollection: MongoDBCollectionResource = {
|
const newMongoCollection: MongoDBCollectionResource = {
|
||||||
...this.mongoDBCollectionResource,
|
...this.mongoDBCollectionResource,
|
||||||
indexes: newMongoIndexes
|
indexes: newMongoIndexes
|
||||||
};
|
};
|
||||||
|
|
||||||
this.mongoDBCollectionResource = await updateMongoDBCollectionThroughRP(
|
this.mongoDBCollectionResource = await updateMongoDBCollectionThroughRP(
|
||||||
this.collection.databaseId,
|
this.collection.databaseId,
|
||||||
this.collection.id(),
|
this.collection.id(),
|
||||||
@ -413,6 +416,34 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
indexesToAdd: [],
|
indexesToAdd: [],
|
||||||
currentMongoIndexes: [...this.mongoDBCollectionResource.indexes]
|
currentMongoIndexes: [...this.mongoDBCollectionResource.indexes]
|
||||||
});
|
});
|
||||||
|
traceSuccess(
|
||||||
|
Action.MongoIndexUpdated,
|
||||||
|
{
|
||||||
|
databaseAccountName: this.container.databaseAccount()?.name,
|
||||||
|
databaseName: this.collection?.databaseId,
|
||||||
|
collectionName: this.collection?.id(),
|
||||||
|
defaultExperience: this.container.defaultExperience(),
|
||||||
|
dataExplorerArea: Constants.Areas.Tab,
|
||||||
|
tabTitle: this.props.settingsTab.tabTitle()
|
||||||
|
},
|
||||||
|
startKey
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
traceFailure(
|
||||||
|
Action.MongoIndexUpdated,
|
||||||
|
{
|
||||||
|
databaseAccountName: this.container.databaseAccount()?.name,
|
||||||
|
databaseName: this.collection?.databaseId,
|
||||||
|
collectionName: this.collection?.id(),
|
||||||
|
defaultExperience: this.container.defaultExperience(),
|
||||||
|
dataExplorerArea: Constants.Areas.Tab,
|
||||||
|
tabTitle: this.props.settingsTab.tabTitle(),
|
||||||
|
error: error.message
|
||||||
|
},
|
||||||
|
startKey
|
||||||
|
);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.state.isScaleSaveable) {
|
if (this.state.isScaleSaveable) {
|
||||||
@ -542,7 +573,7 @@ export class SettingsComponent extends React.Component<SettingsComponentProps, S
|
|||||||
defaultExperience: this.container.defaultExperience(),
|
defaultExperience: this.container.defaultExperience(),
|
||||||
dataExplorerArea: Constants.Areas.Tab,
|
dataExplorerArea: Constants.Areas.Tab,
|
||||||
tabTitle: this.props.settingsTab.tabTitle(),
|
tabTitle: this.props.settingsTab.tabTitle(),
|
||||||
error: reason
|
error: reason.message
|
||||||
},
|
},
|
||||||
startKey
|
startKey
|
||||||
);
|
);
|
||||||
|
@ -1222,7 +1222,7 @@ export default class SettingsTab extends TabsBase implements ViewModels.WaitsFor
|
|||||||
defaultExperience: this.container.defaultExperience(),
|
defaultExperience: this.container.defaultExperience(),
|
||||||
dataExplorerArea: Constants.Areas.Tab,
|
dataExplorerArea: Constants.Areas.Tab,
|
||||||
tabTitle: this.tabTitle(),
|
tabTitle: this.tabTitle(),
|
||||||
error: error
|
error: error.message
|
||||||
},
|
},
|
||||||
startKey
|
startKey
|
||||||
);
|
);
|
||||||
|
@ -89,7 +89,8 @@ export enum Action {
|
|||||||
ClickResourceTreeNodeContextMenuItem,
|
ClickResourceTreeNodeContextMenuItem,
|
||||||
DiscardSettings,
|
DiscardSettings,
|
||||||
SettingsV2Updated,
|
SettingsV2Updated,
|
||||||
SettingsV2Discarded
|
SettingsV2Discarded,
|
||||||
|
MongoIndexUpdated
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ActionModifiers = {
|
export const ActionModifiers = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user