From f7ac1d89ffad60d810d639f53ca4303d9574021c Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 11 Apr 2016 14:40:54 +0300 Subject: [PATCH] fix undefined next --- src/routes/feeds.js | 4 ++-- src/sitemap.js | 23 +++++++++++------------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/routes/feeds.js b/src/routes/feeds.js index bfa2945fb5..09f3f1826e 100644 --- a/src/routes/feeds.js +++ b/src/routes/feeds.js @@ -107,7 +107,7 @@ function generateForUserTopics(req, res, callback) { } ], function(err, userData) { if (err) { - return next(err); + return callback(err); } generateForTopics({ @@ -116,7 +116,7 @@ function generateForUserTopics(req, res, callback) { description: 'A list of topics that are posted by ' + userData.username, feed_url: '/user/' + userslug + '/topics.rss', site_url: '/user/' + userslug + '/topics' - }, 'uid:' + userData.uid + ':topics', req, res, next); + }, 'uid:' + userData.uid + ':topics', req, res, callback); }); } diff --git a/src/sitemap.js b/src/sitemap.js index 4c7efb73b5..00bb195809 100644 --- a/src/sitemap.js +++ b/src/sitemap.js @@ -1,16 +1,15 @@ 'use strict'; -var path = require('path'), - async = require('async'), - sm = require('sitemap'), - url = require('url'), - nconf = require('nconf'), - db = require('./database'), - categories = require('./categories'), - topics = require('./topics'), - privileges = require('./privileges'), - meta = require('./meta'), - utils = require('../public/src/utils'); +var async = require('async'); +var sm = require('sitemap'); +var nconf = require('nconf'); + +var db = require('./database'); +var categories = require('./categories'); +var topics = require('./topics'); +var privileges = require('./privileges'); +var meta = require('./meta'); +var utils = require('../public/src/utils'); var sitemap = { maps: { @@ -88,7 +87,7 @@ sitemap.getPages = function(callback) { changefreq: 'daily', priority: '0.4' }]; - + sitemap.maps.pages = sm.createSitemap({ hostname: nconf.get('url'), cacheTime: 1000 * 60 * 60 * 24, // Cached for 24 hours