Skip to content

Commit

Permalink
Merge pull request #133 from mercedes-benz/VULCAN-316/OverloadMessage
Browse files Browse the repository at this point in the history
fix: overload dashboard message
  • Loading branch information
m-o-n-i-s-h committed Jul 22, 2024
2 parents 263fc03 + 6375718 commit 622798f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/report/Report.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ export const NeoReport = ({
}
/>
);
} else if (status == QueryStatus.OVER_LOAD) {
return <NeoCodeViewerComponent value={`Loading took too long. Please reload report or complete page.`} />;
}
return (
<NeoCodeViewerComponent
Expand Down
8 changes: 8 additions & 0 deletions src/report/ReportQueryRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum QueryStatus {
WAITING, // The report is waiting for custom logic to be executed.
RUNNING, // The report query is running.
TIMED_OUT, // Query has reached the time limit.
OVER_LOAD, // Dashboard doesn't load if too many tabs opened at the same time. (VULCAN-315)
COMPLETE, // There is data returned, and we can visualize it all.
COMPLETE_TRUNCATED, // There is data returned, but it's too much so we truncate it.
ERROR, // Something broke, likely the cypher query is invalid.
Expand Down Expand Up @@ -143,6 +144,13 @@ export async function runCypherQuery(
return e.message;
}

if (e.message.startsWith('Failed to establish connection in 30000ms')) {
setStatus(QueryStatus.OVER_LOAD);
setRecords([{ error: 'Loading took too long. Please reload page.' }]);
transaction.rollback();
return 'Loading took too long. Please reload page.';
}

setStatus(QueryStatus.ERROR);
// Process other errors.
if (setRecords) {
Expand Down

0 comments on commit 622798f

Please sign in to comment.