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 {
81
81
* @return {Promise } queue
82
82
*/
83
83
async fetchArticles ( ) {
84
- const { client, config, _cachedArticles } = this ;
84
+ const { client, config } = this ;
85
85
const articles = await client . getArticles ( ) ;
86
86
if ( ! Array . isArray ( articles . data ) ) {
87
87
throw new Error (
@@ -95,6 +95,9 @@ class Downloader {
95
95
)
96
96
. filter ( article => ( config . onlyPublic ? ! ! article . public : true ) )
97
97
. map ( article => lodash . pick ( article , PICK_PROPERTY ) ) ;
98
+
99
+ this . _cachedArticles = this . _cachedArticles . filter ( cache => realArticles . findIndex ( ( item ) => item . slug === cache . slug ) != - 1 ) ;
100
+
98
101
const queue = new Queue ( { concurrency : config . concurrency } ) ;
99
102
100
103
let article ;
@@ -105,6 +108,8 @@ class Downloader {
105
108
const findIndexFn = function ( item ) {
106
109
return item . slug === article . slug ;
107
110
} ;
111
+
112
+ const { _cachedArticles } = this ;
108
113
109
114
for ( let i = 0 ; i < realArticles . length ; i ++ ) {
110
115
article = realArticles [ i ] ;
You can’t perform that action at this time.
0 commit comments