Merge pull request #15095 from grafana/hugoh/bug-inifinite-loop-when-scan-for-older-logs-clicked

Making sure we do not pass a long invalid queries and save to state
pull/15098/head
Torkel Ödegaard 6 years ago committed by GitHub
commit 5768593da7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      public/app/features/explore/state/actions.ts
  2. 3
      public/app/plugins/datasource/loki/language_provider.ts

@ -538,6 +538,7 @@ export function runQueries(exploreId: ExploreId) {
if (!hasNonEmptyQuery(modifiedQueries)) {
dispatch({ type: ActionTypes.RunQueriesEmpty, payload: { exploreId } });
dispatch(stateSave()); // Remember to saves to state and update location
return;
}

@ -173,8 +173,9 @@ export default class LokiLanguageProvider extends LanguageProvider {
})
);
}
// Return a cleaned LokiQuery
return queries.map(query => ({
...query,
refId: query.refId,
expr: '',
}));
}

Loading…
Cancel
Save