[AI assisted]: Improve system console statistics performance (#29899)

```release-note
NONE
```

Co-authored-by: Matthew Birtch <mattbirtch@gmail.com>
Этот коммит содержится в:
Agniva De Sarker
2025-02-04 21:54:01 +05:30
коммит произвёл GitHub
родитель 6046a304b2
Коммит ae9e6174e5
45 изменённых файлов: 1052 добавлений и 407 удалений

Просмотреть файл

@@ -96,6 +96,14 @@ function dbUpdateUserSession(params: UpdateUserSessionParam): ChainableT<UpdateU
}
Cypress.Commands.add('dbUpdateUserSession', dbUpdateUserSession);
function dbRefreshPostStats(): ChainableT<{success?: boolean; skipped?: boolean; message?: string}> {
return cy.task('dbRefreshPostStats', {dbConfig}).then(({success, skipped, message, errorMessage, error}) => {
verifyError(error, errorMessage);
return cy.wrap({success, skipped, message});
});
}
Cypress.Commands.add('dbRefreshPostStats', dbRefreshPostStats);
function verifyError(error, errorMessage) {
if (errorMessage) {
expect(errorMessage, `${errorMessage}\n\n${message}\n\n${JSON.stringify(error)}`).to.be.undefined;
@@ -150,6 +158,15 @@ declare global {
* @returns {Session} session
*/
dbUpdateUserSession: typeof dbUpdateUserSession;
/**
* Refreshes PostgreSQL materialized views for post statistics
* @returns {Object} result
* @returns {boolean} result.success - true if refresh was successful
* @returns {boolean} result.skipped - true if operation was skipped (non-PostgreSQL)
* @returns {string} result.message - message when operation is skipped
*/
dbRefreshPostStats: typeof dbRefreshPostStats;
}
}
}