fix: finish weixin login only after gateway restart
This commit is contained in:
@@ -468,7 +468,7 @@ async function _runLogin({ callId, timeoutMs, botType, emit, isAborted }) {
|
||||
_bumpOpenClawConfigTimestamp();
|
||||
_ensureWeixinStateOwnership();
|
||||
log.info('weixin', `callId=${callId} login success accountId=${accountId} file=${filePath}`);
|
||||
emit({ action: 'finish', event: 'success', data: { accountId } });
|
||||
emit({ action: 'progress', event: 'login_success', data: { accountId } });
|
||||
emit({
|
||||
action: 'progress',
|
||||
event: 'gateway_restarting',
|
||||
@@ -479,9 +479,12 @@ async function _runLogin({ callId, timeoutMs, botType, emit, isAborted }) {
|
||||
});
|
||||
const gatewayRestart = _restartGateway();
|
||||
emit({
|
||||
action: 'event',
|
||||
event: gatewayRestart.ok ? 'gateway_restart_succeeded' : 'gateway_restart_failed',
|
||||
data: gatewayRestart,
|
||||
action: 'finish',
|
||||
event: 'success',
|
||||
data: {
|
||||
accountId,
|
||||
gatewayRestart,
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user