File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -200,8 +200,9 @@ cmsApi.getEntries = function(params) {
200
200
syncCMSDataToDB ( params ) ;
201
201
}
202
202
else {
203
+ const metaEntry = entries . find ( ( item ) => item . _id . endsWith ( 'meta' ) ) ;
203
204
const updateInterval = UPDATE_INTERVAL * 60 * 60 * 1000 ;
204
- const timeDifference = Date . now ( ) - entries [ 0 ] . lu ;
205
+ const timeDifference = Date . now ( ) - ( metaEntry . lu || entries [ 0 ] . lu ) ;
205
206
206
207
// Update if the update interval has passed
207
208
if ( timeDifference >= updateInterval ) {
@@ -210,7 +211,6 @@ cmsApi.getEntries = function(params) {
210
211
}
211
212
// Update if the refresh flag is set and the meta entry does not contain an error
212
213
else if ( params . qstring . refresh ) {
213
- let metaEntry = entries . find ( ( item ) => item . _id . endsWith ( 'meta' ) ) ;
214
214
if ( metaEntry && ! metaEntry . error ) {
215
215
results . updating = true ;
216
216
syncCMSDataToDB ( params ) ;
You can’t perform that action at this time.
0 commit comments