Skip to content
/ api Public

Commit a0841a2

Browse files
committed
bug: check if timestamp is a real date
1 parent 7c4187b commit a0841a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/k8s/logging/logging.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ export class LoggingService {
313313
for (let data of text.split(/\n/)) {
314314
const { timestamp, log } = this.parseLog(data);
315315

316-
if (new Date(timestamp)) {
317-
const latestTimestamp = new Date(timestamp);
316+
const latestTimestamp = new Date(timestamp);
318317

318+
if (latestTimestamp && !Number.isNaN(latestTimestamp.getTime())) {
319319
if (!oldestTimestamp || oldestTimestamp > latestTimestamp) {
320320
if (!oldestTimestamp) {
321321
stream.emit(

0 commit comments

Comments
 (0)