mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-27 17:33:02 +02:00
fixing issues with shutting down of tasks
This commit is contained in:
parent
b2de1cda17
commit
eb09c2f08e
2 changed files with 10 additions and 2 deletions
|
@ -132,7 +132,15 @@ export function createMindServer(host_public = false, port = 8080) {
|
||||||
|
|
||||||
socket.on('shutdown', () => {
|
socket.on('shutdown', () => {
|
||||||
console.log('Shutting down');
|
console.log('Shutting down');
|
||||||
process.exit(0);
|
for (let agentName in agent_connections) {
|
||||||
|
mindcraft.stopAgent(agentName);
|
||||||
|
}
|
||||||
|
// wait 2 seconds
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log('Exiting MindServer');
|
||||||
|
process.exit(0);
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('send-message', (agentName, message) => {
|
socket.on('send-message', (agentName, message) => {
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": "debug",
|
"type": "debug",
|
||||||
"timeout": 60
|
"timeout": 25
|
||||||
},
|
},
|
||||||
"debug_2_agent_timeout": {
|
"debug_2_agent_timeout": {
|
||||||
"goal": "Just stand at a place and don't do anything",
|
"goal": "Just stand at a place and don't do anything",
|
||||||
|
|
Loading…
Add table
Reference in a new issue