mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Loki: Use queries maxLines
if configured, even if it is zero (#61652)
* user `query.maxLines` even if it is zero * remove unnecessary comment
This commit is contained in:
parent
a5d577eca1
commit
6c566a391d
@ -176,6 +176,10 @@ describe('LokiDatasource', () => {
|
||||
await runTest(80, '40', 80, undefined);
|
||||
});
|
||||
|
||||
it('should use query max lines, if both exist, even if it is 0', async () => {
|
||||
await runTest(0, '40', 0, undefined);
|
||||
});
|
||||
|
||||
it('should report query interaction', async () => {
|
||||
await runTest(80, '40', 80, CoreApp.Explore);
|
||||
expect(reportInteraction).toHaveBeenCalledWith(
|
||||
|
@ -174,7 +174,7 @@ export class LokiDatasource
|
||||
query(request: DataQueryRequest<LokiQuery>): Observable<DataQueryResponse> {
|
||||
const queries = request.targets
|
||||
.map(getNormalizedLokiQuery) // "fix" the `.queryType` prop
|
||||
.map((q) => ({ ...q, maxLines: q.maxLines || this.maxLines })); // set maxLines if not set
|
||||
.map((q) => ({ ...q, maxLines: q.maxLines ?? this.maxLines }));
|
||||
|
||||
const fixedRequest: DataQueryRequest<LokiQuery> & { targets: LokiQuery[] } = {
|
||||
...request,
|
||||
|
Loading…
Reference in New Issue
Block a user