Skip to content
Snippets Groups Projects
Verified Commit f84f6c6b authored by Erick Hitter's avatar Erick Hitter
Browse files

Increase status endpoint cache life

Also, allow disconnect endpoint to force things
parent 3113ba15
No related branches found
No related tags found
No related merge requests found
......@@ -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 );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment