Give more time to setting up containers
This commit is contained in:
parent
71079ceb19
commit
567ca0322a
1 changed files with 7 additions and 5 deletions
|
@ -107,7 +107,7 @@ class LanguageHandler extends AkairoHandler {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await this.handleSpawn(proc);
|
const result = await this.handleSpawn(proc, true);
|
||||||
return result;
|
return result;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.containers.delete(dockerID);
|
this.containers.delete(dockerID);
|
||||||
|
@ -117,11 +117,13 @@ class LanguageHandler extends AkairoHandler {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSpawn(proc) {
|
handleSpawn(proc, withTimeout = false) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
setTimeout(() => {
|
if (withTimeout) {
|
||||||
reject(new Error('Timed out'));
|
setTimeout(() => {
|
||||||
}, this.client.config.timeout);
|
reject(new Error('Timed out'));
|
||||||
|
}, this.client.config.timeout);
|
||||||
|
}
|
||||||
|
|
||||||
let data = '';
|
let data = '';
|
||||||
proc.stdout.on('data', chunk => {
|
proc.stdout.on('data', chunk => {
|
||||||
|
|
Loading…
Reference in a new issue