Merge pull request #6682 from dmytro-landiak/fix/slow-query-logging

[3.4] fixing slow queries logging
This commit is contained in:
Andrew Shvayka 2022-06-10 14:46:53 +03:00 committed by GitHub
commit ba9a768f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -369,7 +369,7 @@ public class DefaultEntityQueryRepository implements EntityQueryRepository {
try {
return jdbcTemplate.queryForObject(countQuery, ctx, Long.class);
} finally {
queryLog.logQuery(ctx, ctx.getQuery(), System.currentTimeMillis() - startTs);
queryLog.logQuery(ctx, countQuery, System.currentTimeMillis() - startTs);
}
});
}
@ -481,7 +481,7 @@ public class DefaultEntityQueryRepository implements EntityQueryRepository {
try {
rows = jdbcTemplate.queryForList(dataQuery, ctx);
} finally {
queryLog.logQuery(ctx, countQuery, System.currentTimeMillis() - startTs);
queryLog.logQuery(ctx, dataQuery, System.currentTimeMillis() - startTs);
}
return EntityDataAdapter.createEntityData(pageLink, selectionMapping, rows, totalElements);
});