mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-19 03:42:23 -06:00
feat: add disconnection information to BaileysStartupService and Instance model
- Updated BaileysStartupService to include disconnection handling logic. - Enhanced Instance model to store disconnection status and details.
This commit is contained in:
@@ -397,6 +397,9 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
this.sendDataWebhook(Events.STATUS_INSTANCE, {
|
||||
instance: this.instance.name,
|
||||
status: 'closed',
|
||||
disconnectionAt: new Date(),
|
||||
disconnectionReasonCode: statusCode,
|
||||
disconnectionObject: JSON.stringify(lastDisconnect),
|
||||
});
|
||||
|
||||
if (this.configService.get<Database>('DATABASE').ENABLED) {
|
||||
@@ -404,6 +407,9 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
where: { id: this.instanceId },
|
||||
data: {
|
||||
connectionStatus: 'close',
|
||||
disconnectionAt: new Date(),
|
||||
disconnectionReasonCode: statusCode,
|
||||
disconnectionObject: JSON.stringify(lastDisconnect),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user