From 94e10c8c32151699aa2cb0903b968e784d82bf70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 19 Nov 2018 15:14:39 -0500 Subject: [PATCH] closes #6972 --- install/data/defaults.json | 1 + src/controllers/sitemap.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/install/data/defaults.json b/install/data/defaults.json index 587167f662..391fb0178d 100644 --- a/install/data/defaults.json +++ b/install/data/defaults.json @@ -91,6 +91,7 @@ "userSearchResultsPerPage": 50, "maximumGroupNameLength": 255, "preventTopicDeleteAfterReplies": 0, + "feeds:disableSitemap": 0, "sitemapTopics": 500, "maintenanceMode": 0, "votesArePublic": 0, diff --git a/src/controllers/sitemap.js b/src/controllers/sitemap.js index 69d2df50c6..36dd89fba5 100644 --- a/src/controllers/sitemap.js +++ b/src/controllers/sitemap.js @@ -8,6 +8,9 @@ var meta = require('../meta'); var sitemapController = module.exports; sitemapController.render = function (req, res, next) { + if (meta.config['feeds:disableSitemap']) { + return setImmediate(next); + } async.waterfall([ function (next) { sitemap.render(next); @@ -38,7 +41,7 @@ sitemapController.getTopicPage = function (req, res, next) { function sendSitemap(method, res, callback) { if (meta.config['feeds:disableSitemap']) { - return callback(); + return setImmediate(callback); } async.waterfall([ function (next) {