fixing slow queries logging

This commit is contained in:
dlandiak 2022-06-10 13:24:20 +03:00
parent 9afdd97363
commit fd53c24346

View File

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