Increase status endpoint cache life

Also, allow disconnect endpoint to force things
parent 3113ba15
......@@ -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 );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment