Skip to content

Commit

Permalink
Merge pull request #23 from Financial-Times/distinct-uuid-cache
Browse files Browse the repository at this point in the history
Distinct uuid cache for uuid and products requests
  • Loading branch information
ironsidevsquincy authored Feb 9, 2017
2 parents 71fbe7e + 19be086 commit 7afb80e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function uuid(){

function products(){
const cachedProducts = cache('products');
const cachedUUID = cache('uuid');
const cachedUUID = cache('uuid-products');

if(cachedProducts && cachedUUID){
return Promise.resolve({products:cachedProducts, uuid:cachedUUID});
Expand All @@ -32,7 +32,7 @@ function products(){
if(!promises.products){
promises.products = request('/products').then(function(response){
cache('products', response.products);
cache('uuid', response.uuid);
cache('uuid-products', response.uuid);
return response;
});
}
Expand Down

0 comments on commit 7afb80e

Please sign in to comment.