This repository was archived by the owner on Oct 12, 2021. It is now read-only.
File tree 6 files changed +6
-4
lines changed
6 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ export const PodcastSchema = new Schema(
106
106
type : Number ,
107
107
default : 0 ,
108
108
} ,
109
+ // @deprecated : considering the huge collection size the count op is really slow
109
110
postCount : {
110
111
type : Number ,
111
112
default : 0 ,
Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ export const RSSSchema = new Schema(
100
100
type : Number ,
101
101
default : 0 ,
102
102
} ,
103
+ // @deprecated : considering the huge collection size the count op is really slow
103
104
postCount : {
104
105
type : Number ,
105
106
default : 0 ,
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ export async function handlePodcast(job) {
217
217
await Podcast . update (
218
218
{ _id : podcastID } ,
219
219
{
220
- postCount : await Episode . count ( { podcast : podcastID } ) ,
220
+ // postCount: await Episode.count({ podcast: podcastID }),
221
221
fingerprint : podcastContent . fingerprint ,
222
222
guidStability : guidStability || podcast . guidStability ,
223
223
} ,
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ export async function handleRSS(job) {
217
217
await RSS . update (
218
218
{ _id : rssID } ,
219
219
{
220
- postCount : await Article . count ( { rss : rssID } ) ,
220
+ // postCount: await Article.count({ rss: rssID }),
221
221
fingerprint : rssContent . fingerprint ,
222
222
guidStability : guidStability || rss . guidStability ,
223
223
} ,
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ describe('Podcast worker', () => {
123
123
124
124
it ( 'should update feed data' , async ( ) => {
125
125
const podcast = await Podcast . findById ( data . podcast ) ;
126
- expect ( podcast . postCount ) . to . be . equal ( initialEpisodes . length + 649 ) ;
126
+ // expect(podcast.postCount).to.be.equal(initialEpisodes.length + 649);
127
127
} ) ;
128
128
129
129
it ( 'should add episode data to Stream feed' , async ( ) => {
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ describe('RSS worker', () => {
237
237
238
238
it ( 'should update feed data' , async ( ) => {
239
239
const rss = await RSS . findById ( data . rss ) ;
240
- expect ( rss . postCount ) . to . be . equal ( initialArticles . length + newArticleCount ) ;
240
+ // expect(rss.postCount).to.be.equal(initialArticles.length + newArticleCount);
241
241
expect ( rss . guidStability ) . to . be . equal ( 'STABLE' ) ;
242
242
} ) ;
243
243
You can’t perform that action at this time.
0 commit comments