Skip to content
This repository was archived by the owner on Oct 12, 2021. It is now read-only.

Commit 3a46db0

Browse files
committed
Merge branch 'master' of github.com:GetStream/Winds
2 parents 216bf2b + 92686d3 commit 3a46db0

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

api/src/workers/podcast.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export async function handlePodcast(job) {
182182
tasks.push(OgQueueAdd({ type: 'episode', podcast: podcastID, urls: updatedEpisodes.map(e => e.link) }, queueOpts));
183183
}
184184
const allowedLanguage = [null, undefined, '', 'eng'].includes(podcast.language);
185-
if (await tryCreateQueueFlag('stream', 'podcast', podcastID, streamTTL) && allowedLanguage) {
185+
if (allowedLanguage) {
186186
tasks.push(StreamQueueAdd({ podcast: podcastID, contentIds: updatedEpisodes.map(e => e._id) }, queueOpts));
187187
}
188188
statsd.increment('winds.handle_podcast.result.updates');

api/src/workers/rss.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export async function handleRSS(job) {
203203
tasks.push(OgQueueAdd({ type: 'article', rss: rssID, urls: updatedArticles.map(a => a.url) }, queueOpts));
204204
}
205205
const allowedLanguage = [null, undefined, '', 'eng'].includes(rss.language);
206-
if (await tryCreateQueueFlag('stream', 'rss', rssID, streamTTL) && allowedLanguage) {
206+
if (allowedLanguage) {
207207
tasks.push(StreamQueueAdd({ rss: rssID, contentIds: updatedArticles.map(a => a._id) }, queueOpts));
208208
}
209209
statsd.increment('winds.handle_rss.result.updates');

api/src/workers/stream.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import logger from '../utils/logger';
1111
import { ProcessStreamQueue, ShutDownStreamQueue } from '../asyncTasks';
1212
import { timeIt } from '../utils/statsd';
1313
import { sendFeedToCollections } from '../utils/collections';
14-
import { removeQueueFlag } from '../utils/queue';
1514
import { startSampling } from '../utils/watchdog';
1615

1716
if (require.main === module) {
@@ -30,6 +29,8 @@ export async function streamProcessor(job) {
3029
const tags = { queue: 'stream' };
3130
const extra = { JobRSS: job.data.rss, JobArticles: job.data.articles };
3231
logger.error('Stream feed job ecountered an error', { err, tags, extra });
32+
//XXX: we have to retry to not lose updates
33+
await job.retry();
3334
}
3435
logger.info(`Completed processing Stream feeds for feed ${job.data.rss}`);
3536
}
@@ -55,8 +56,6 @@ export async function handleStream(job) {
5556
const [type, model, contentModel] =
5657
'rss' in job.data ? ['rss', RSS, Article] : ['podcast', Podcast, Episode];
5758

58-
await removeQueueFlag('stream', type, job.data[type]);
59-
6059
const feed = await model.findById(job.data[type]);
6160
const content = await contentModel.find({ _id: { $in: job.data.contentIds } })
6261
.sort({ publicationDate: -1 })

app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Winds",
3-
"version": "2.1.171",
3+
"version": "2.1.172",
44
"description": "Winds is a beatiful open source RSS Reader and Podcast app. Wind 2.0 was created using React/Redux/Node.\nFor more information, visit https://getstream.io/winds/.\nTo contribute or run your own version head over to Github: https://github.com/getstream/winds",
55
"private": true,
66
"author": "Winds Team <[email protected]>",

app/src/components/RSSArticleList.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,12 @@ class RSSArticleList extends React.Component {
8787
);
8888

8989
this.unsubscribeFromStreamFeed();
90-
this.subscribeToStreamFeed(
91-
nextProps.rssFeed._id,
92-
nextProps.rssFeed.streamToken,
93-
);
90+
if (nextProps.rssFeed) {
91+
this.subscribeToStreamFeed(
92+
nextProps.rssFeed._id,
93+
nextProps.rssFeed.streamToken,
94+
);
95+
}
9496
}
9597

9698
if (!this.props.rssFeed && nextProps.rssFeed) {

0 commit comments

Comments
 (0)