This repository has been archived on 2025-10-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
gekko/web/routes/stopGekko.js
2021-06-06 20:25:14 +02:00

23 lines
414 B
JavaScript

const cache = require('../state/cache');
const gekkoManager = cache.get('gekkos');
// stops a Gekko
// requires a post body with an id
module.exports = function *() {
let id = this.request.body.id;
if(!id) {
this.body = { status: 'not ok' }
return;
}
let stopped = gekkoManager.stop(id);
if(!stopped) {
this.body = { status: 'not ok' }
return;
}
this.body = { status: 'ok' };
}