From e20bdc35660af5ef4e9a147b0ab8ef4d0a3c4991 Mon Sep 17 00:00:00 2001 From: Eden Liu Date: Wed, 21 Jun 2017 17:22:27 +0800 Subject: [PATCH] Increase the setting of fields --- ch19/meadowlark.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ch19/meadowlark.js b/ch19/meadowlark.js index 05278b1..e6484cf 100644 --- a/ch19/meadowlark.js +++ b/ch19/meadowlark.js @@ -271,6 +271,7 @@ function geocodeDealer(dealer){ if(err) return console.log('Geocoding failure for ' + addr); dealer.lat = coords.lat; dealer.lng = coords.lng; + dealer.geocodedAddress = addr; dealer.save(); }); } @@ -321,6 +322,8 @@ dealerCache.refresh = function(cb){ fs.writeFileSync(dealerCache.jsonFile, JSON.stringify(dealers)); fs.writeFileSync(__dirname + '/public/js/dealers-googleMapMarkers.js', dealersToGoogleMaps(dealers)); + + dealerCache.lastRefreshed = Date.now(); // all done -- invoke callback cb();