Give more time to setting up containers

This commit is contained in:
1computer1 2019-05-20 14:55:23 -04:00
parent 71079ceb19
commit 567ca0322a

View file

@ -107,7 +107,7 @@ class LanguageHandler extends AkairoHandler {
]);
try {
const result = await this.handleSpawn(proc);
const result = await this.handleSpawn(proc, true);
return result;
} catch (err) {
this.containers.delete(dockerID);
@ -117,11 +117,13 @@ class LanguageHandler extends AkairoHandler {
});
}
handleSpawn(proc) {
handleSpawn(proc, withTimeout = false) {
return new Promise((resolve, reject) => {
if (withTimeout) {
setTimeout(() => {
reject(new Error('Timed out'));
}, this.client.config.timeout);
}
let data = '';
proc.stdout.on('data', chunk => {