Skip to content

Commit 4f5882d

Browse files
committed
Reduce logging amount
1 parent 2853490 commit 4f5882d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/actions/ytFeed.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,12 @@ export function ytFeed(client: Client) {
7171
const data = jsonFromXML<YTFeedData>(rawBody);
7272
const { entry } = data.feed;
7373

74-
if (!entry) return log("yellow", "Missing entry data");
74+
if (!entry) return;
7575

7676
const videoId = entry["yt:videoId"]._text;
7777
const publishUnix = new Date(entry.published._text).getTime();
7878

79-
if ((Date.now() - publishUnix) > MAX_CACHE_AGE) return log("yellow", `Skipped ${videoId}; age over ${MAX_CACHE_AGE.toLocaleString()}ms`);
80-
81-
if (client.ytCache.has(videoId)) return log("yellow", `Skipped ${videoId}; already cached`);
79+
if (((Date.now() - publishUnix) > MAX_CACHE_AGE) || client.ytCache.has(videoId)) return;
8280

8381
client.ytCache.add(videoId);
8482

0 commit comments

Comments
 (0)