From 2b960f6f44f28cb17bdcb29e9ed07093aaac2e03 Mon Sep 17 00:00:00 2001 From: Samer Albahra Date: Tue, 11 Aug 2015 15:28:41 -0500 Subject: [PATCH] Additional minor improvements --- server.js | 4 ++++ test/api.js | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/server.js b/server.js index af07d0a..9edc120 100644 --- a/server.js +++ b/server.js @@ -42,6 +42,10 @@ new CronJob( "0 0 0 * * *", function() { // Find all records in the weather cache Cache.find( {}, function( err, records ) { + if ( err ) { + return; + } + // Cycle through each record records.forEach( function( record ) { diff --git a/test/api.js b/test/api.js index a132faa..0d10f2b 100644 --- a/test/api.js +++ b/test/api.js @@ -57,12 +57,13 @@ describe( "Weather API", function() { function apiTest( opt ) { - var opt = extend( {}, { - method: 0, - key: "", - format: "json" - }, opt ), - url = "/" + opt.method + "?loc=" + opt.loc + "&key=" + opt.key + "&format=" + opt.format; + opt = extend( {}, { + method: 0, + key: "", + format: "json" + }, opt ); + + var url = "/" + opt.method + "?loc=" + opt.loc + "&key=" + opt.key + "&format=" + opt.format; setupMocks( opt.loc );