🔧 fix(lib/login/napcat): increase QR update timeout from 30s to 90s for better handling of delays

This commit is contained in:
Jerry 2025-12-20 20:11:47 +08:00
parent b08e83bc18
commit 2abddce9f1

View File

@ -46,15 +46,19 @@ export default class NapcatService {
if (!fs.existsSync(shFile)) {
const scriptContent = `#!/bin/bash\nxvfb-run -a qq --no-sandbox -q ${qq}\n`;
fs.writeFileSync(shFile, scriptContent, { mode: 0o755 });
logger.info(`[crystelf-admin] 写入运行脚本,:${qq}.sh`);
}
try {
await execAsync(`tmux has-session -t ${nickname}`);
// 存在就先干掉
logger.info('[crystelf-admin] 存在会话,将停止会话')
await execAsync(`tmux kill-session -t ${nickname}`);
await execAsync(`tmux new -s ${nickname} -d "bash '${shFile}'"`);
logger.info('[crystelf-admin] 新建会话');
} catch {
// 不存在再新建
await execAsync(`tmux new -s ${nickname} -d "bash '${shFile}'"`);
logger.info('[crystelf-admin] 新建会话');
}
return await this.waitForQrUpdate();