meddelare-server
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -8,3 +8,4 @@ var express = require("express"); | ||
var LOCAL_CACHE_TIME_GOOD_RESULT = 4 * 60 * 1000, | ||
LOCAL_CACHE_TIME_BAD_RESULT = 1 * 60 * 1000; | ||
LOCAL_CACHE_TIME_BAD_RESULT = 1 * 60 * 1000, | ||
LOCAL_CACHE_TIME_TIMEOUT_RESULT = 10 * 1000; | ||
@@ -144,3 +145,6 @@ // Return this count if none was found or an error was thrown. | ||
return retrieveCount(url, network) | ||
// If the lookup yielded no result, kick off a request and put it in the cache for now. | ||
// This way the .resolve(cache) call above makes sure multiple requests count requests | ||
// for the same network/url cannot be sent at the same time. | ||
var retrieveCountPromise = retrieveCount(url, network) | ||
.tap(function(uncachedResult) { | ||
@@ -158,2 +162,7 @@ console.log(cacheKey, "fetched good result", uncachedResult); | ||
}); | ||
// Setting a cache timeout just in case, even though it can lead to parallel requests. | ||
cache.put(cacheKey, retrieveCountPromise, LOCAL_CACHE_TIME_TIMEOUT_RESULT); | ||
return retrieveCountPromise; | ||
}); | ||
@@ -160,0 +169,0 @@ } |
{ | ||
"name": "meddelare-server", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Install custom social share counters on your website with your own hosted solution, which only makes a single API request and loads minimal or zero assets to display the counters.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://meddelare.com/", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19339
249