hmpo-cached-model
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -22,3 +22,3 @@ 'use strict'; | ||
if (!this.lastModified) return cb(); | ||
debug('Checking store last modified time', this.options.name); | ||
debug('Checking store last modified time', this.options.key); | ||
this.options.store.get( | ||
@@ -30,3 +30,3 @@ this.keyLastModified, | ||
if (lastModified && lastModified > this.lastModified) return cb(); | ||
debug('Store data has not been modified', this.options.name); | ||
debug('Store data has not been modified', this.options.key); | ||
cb(HmpoCachedModel.ABORT); | ||
@@ -38,3 +38,3 @@ } | ||
getStoreData(cb) { | ||
debug('Getting store data', this.options.name); | ||
debug('Getting store data', this.options.key); | ||
this.options.store.get( | ||
@@ -59,3 +59,3 @@ this.keyData, | ||
getNextCheckTime(cb) { | ||
debug('Checking API next check time', this.options.name); | ||
debug('Checking API next check time', this.options.key); | ||
this.options.store.get( | ||
@@ -73,3 +73,3 @@ this.keyNextCheck, | ||
setNextCheckTime(cb) { | ||
debug('Store next check time', this.options.name); | ||
debug('Store next check time', this.options.key); | ||
this.options.store.set( | ||
@@ -83,3 +83,3 @@ this.keyNextCheck, | ||
getDataFromAPI(cb) { | ||
debug('Fetch data from API', this.options.name); | ||
debug('Fetch data from API', this.options.key); | ||
this.fetch({ url: this.options.url }, (err, data) => { | ||
@@ -101,3 +101,3 @@ if (err) return cb(err); | ||
storeDataFromAPI(cb) { | ||
debug('Store data', this.options.name); | ||
debug('Store data', this.options.key); | ||
this.options.store.set( | ||
@@ -111,3 +111,3 @@ this.keyData, | ||
storeLastModifiedFromAPI(cb) { | ||
debug('Store modified time', this.options.name); | ||
debug('Store modified time', this.options.key); | ||
this.options.store.set( | ||
@@ -114,0 +114,0 @@ this.keyLastModified, |
{ | ||
"name": "hmpo-cached-model", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Cached polling model", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
25372