mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
Signed-off-by: Luis Baronceli <luisbaronceli@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import * as deepMerge from 'deepmerge';
|
||||
import {Observable} from 'rxjs';
|
||||
import {map, repeat, retry} from 'rxjs/operators';
|
||||
import {filter, map, repeat, retry} from 'rxjs/operators';
|
||||
|
||||
import * as models from '../models';
|
||||
import {isValidURL} from '../utils';
|
||||
@@ -318,7 +318,17 @@ export class ApplicationsService {
|
||||
}): Observable<models.LogEntry> {
|
||||
const {applicationName} = query;
|
||||
const search = this.getLogsQuery(query);
|
||||
const entries = requests.loadEventSource(`/applications/${applicationName}/logs?${search.toString()}`).pipe(map(data => JSON.parse(data).result as models.LogEntry));
|
||||
const entries = requests.loadEventSource(`/applications/${applicationName}/logs?${search.toString()}`).pipe(
|
||||
map(data => {
|
||||
try {
|
||||
const parsed = JSON.parse(data);
|
||||
return parsed && parsed.result ? (parsed.result as models.LogEntry) : null;
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}),
|
||||
filter((result): result is models.LogEntry => !!result)
|
||||
);
|
||||
let first = true;
|
||||
return new Observable(observer => {
|
||||
const subscription = entries.subscribe(
|
||||
|
||||
Reference in New Issue
Block a user