More bug fixes
parent
f55db08f36
commit
d6ec1d6a6c
|
@ -126,9 +126,8 @@ export default class CWG_Create extends Command {
|
|||
|
||||
return Promise.all(completed);
|
||||
} catch (err) {
|
||||
await fs.unlink(`/etc/nginx/sites-available/${args[1]}`);
|
||||
await fs.unlink(`/etc/nginx/sites-enabled/${args[1]}`);
|
||||
await this.client.db.Domain.deleteMany({ domain: args[1] });
|
||||
const tasks = [fs.unlink(`/etc/nginx/sites-enabled/${args[1]}`), fs.unlink(`/etc/nginx/sites-available/${args[1]}`), this.client.db.Domain.deleteMany({ domain: args[1] })];
|
||||
await Promise.allSettled(tasks);
|
||||
return this.client.util.handleError(err, message, this);
|
||||
}
|
||||
}
|
||||
|
@ -182,7 +181,7 @@ export default class CWG_Create extends Command {
|
|||
} catch (error) {
|
||||
const tasks = [fs.unlink(`/etc/nginx/sites-enabled/${domain}`), fs.unlink(`/etc/nginx/sites-available/${domain}`), this.client.db.Domain.deleteMany({ domain })];
|
||||
await Promise.allSettled(tasks);
|
||||
return Promise.reject(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue