mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 15:35:47 +01:00
closed #296
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
if (process.env.NODE_ENV === 'development') winston.info('[rss] Updating RSS feeds for topic ' + tid);
|
if (process.env.NODE_ENV === 'development') winston.info('[rss] Updating RSS feeds for topic ' + tid);
|
||||||
|
|
||||||
topics.getTopicWithPosts(tid, 0, 0, -1, function(err, topicData) {
|
topics.getTopicWithPosts(tid, 0, 0, -1, function(err, topicData) {
|
||||||
if (err) return winston.error('Problem saving topic RSS feed', err.stack);
|
if (err) return callback(new Error('topic-invalid'));
|
||||||
|
|
||||||
var feed = new rss({
|
var feed = new rss({
|
||||||
title: topicData.topic_name,
|
title: topicData.topic_name,
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
Feed.updateCategory = function(cid, callback) {
|
Feed.updateCategory = function(cid, callback) {
|
||||||
if (process.env.NODE_ENV === 'development') winston.info('[rss] Updating RSS feeds for category ' + cid);
|
if (process.env.NODE_ENV === 'development') winston.info('[rss] Updating RSS feeds for category ' + cid);
|
||||||
categories.getCategoryById(cid, 0, function(err, categoryData) {
|
categories.getCategoryById(cid, 0, function(err, categoryData) {
|
||||||
if (err) return winston.error('Could not update RSS feed for category ' + cid, err.stack);
|
if (err) return callback(new Error('category-invalid'));
|
||||||
|
|
||||||
var feed = new rss({
|
var feed = new rss({
|
||||||
title: categoryData.category_name,
|
title: categoryData.category_name,
|
||||||
|
|||||||
@@ -244,8 +244,9 @@ var express = require('express'),
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!fs.existsSync(rssPath)) {
|
if (!fs.existsSync(rssPath)) {
|
||||||
feed.updateTopic(tid, function() {
|
feed.updateTopic(tid, function(err) {
|
||||||
loadFeed();
|
if (err) res.redirect('/404');
|
||||||
|
else loadFeed();
|
||||||
});
|
});
|
||||||
} else loadFeed();
|
} else loadFeed();
|
||||||
|
|
||||||
@@ -320,8 +321,9 @@ var express = require('express'),
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!fs.existsSync(rssPath)) {
|
if (!fs.existsSync(rssPath)) {
|
||||||
feed.updateCategory(cid, function() {
|
feed.updateCategory(cid, function(err) {
|
||||||
loadFeed();
|
if (err) res.redirect('/404');
|
||||||
|
else loadFeed();
|
||||||
});
|
});
|
||||||
} else loadFeed();
|
} else loadFeed();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user