From f84f6c6bfd3153375ce1c01165e351b44685e786 Mon Sep 17 00:00:00 2001 From: Erick Hitter <services@ethitter.com> Date: Tue, 30 Aug 2016 18:01:09 -0700 Subject: [PATCH] Increase status endpoint cache life Also, allow disconnect endpoint to force things --- server.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/server.js b/server.js index 9356c7c..60968bb 100755 --- a/server.js +++ b/server.js @@ -88,7 +88,7 @@ function statusStringtoInt( status ) { */ // Endpoint to check lock status -app.get( '/api/status/:lock_name', cache( '5 seconds' ), function( req, res, next ) { +app.get( '/api/status/:lock_name', cache( '10 seconds' ), function( req, res, next ) { var lockName = req.params.lock_name; // Parse allowed request arguments @@ -195,12 +195,6 @@ app.get( '/api/disconnect/:lock_name', function( req, res, next ) { return; } - // Check if lock is already connected, and bail if it's already disconnected - if ( ! lock.isConnected() ) { - res.sendStatus( 503 ); - return; - } - lock.disconnect(); apicache.clear( '/api/status/' + req.params.lock_name ); res.sendStatus( 204 ); -- GitLab