Skip to content

Commit 088e542

Browse files
author
Farzad Hayatbakhsh
committed
DOC-2608: Time the RSS feed generation and log it
1 parent 9c88453 commit 088e542

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/rssfeed.cjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ const cheerio = require("cheerio");
44

55
module.exports.register = function ({ config }) {
66
this.on("beforePublish", ({ siteCatalog, contentCatalog, playbook }) => {
7+
const startTime = Date.now(); // Start the timer
8+
79
try {
810
// Find the changelog page
911
const page = contentCatalog.findBy({
@@ -104,7 +106,12 @@ module.exports.register = function ({ config }) {
104106
contents: Buffer.from(rss),
105107
out: { path: config.outputFile },
106108
});
107-
console.log(`RSS feed generated at ${config.outputFile}`);
109+
110+
const endTime = Date.now(); // End the timer
111+
const duration = endTime - startTime; // Calculate the duration
112+
console.log(
113+
`RSS feed generated at ${config.outputFile} in ${duration}ms`
114+
);
108115
} catch (error) {
109116
// Catch any errors to allow the build to continue
110117
console.error("Error generating RSS feed:", error);

0 commit comments

Comments
 (0)