File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ class Downloader {
8181 * @return {Promise } queue
8282 */
8383 async fetchArticles ( ) {
84- const { client, config, _cachedArticles } = this ;
84+ const { client, config } = this ;
8585 const articles = await client . getArticles ( ) ;
8686 if ( ! Array . isArray ( articles . data ) ) {
8787 throw new Error (
@@ -95,6 +95,9 @@ class Downloader {
9595 )
9696 . filter ( article => ( config . onlyPublic ? ! ! article . public : true ) )
9797 . map ( article => lodash . pick ( article , PICK_PROPERTY ) ) ;
98+
99+ this . _cachedArticles = this . _cachedArticles . filter ( cache => realArticles . findIndex ( ( item ) => item . slug === cache . slug ) != - 1 ) ;
100+
98101 const queue = new Queue ( { concurrency : config . concurrency } ) ;
99102
100103 let article ;
@@ -105,6 +108,8 @@ class Downloader {
105108 const findIndexFn = function ( item ) {
106109 return item . slug === article . slug ;
107110 } ;
111+
112+ const { _cachedArticles } = this ;
108113
109114 for ( let i = 0 ; i < realArticles . length ; i ++ ) {
110115 article = realArticles [ i ] ;
You can’t perform that action at this time.
0 commit comments