mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-07-09 11:07:35 +08:00
fix(main): 修复 config.json 并发读写导致的 EBUSY 主进程崩溃弹窗
- 主进程 6 个独立 Store 实例合并为共享单例(window-size/lyric/server/deviceInfo/window 复用 config.ts 实例) - initializeConfig 幂等化,修复 set-store-value IPC 监听重复注册导致的双倍写入 - 窗口/歌词窗 move、resize 保存增加 500ms 防抖,拖动时不再每秒几十次写盘,close 时冲刷落盘 - store 读写 IPC handler 与窗口状态读写加 try-catch,撞锁丢弃单次写入而非崩溃 - 全局 uncaughtException 兜底:文件锁类错误(EBUSY/EPERM 等)仅记日志,其余异常保留报错弹窗 Closes #714
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { app } from 'electron';
|
||||
import Store from 'electron-store';
|
||||
import { machineIdSync } from 'node-machine-id';
|
||||
import os from 'os';
|
||||
|
||||
const store = new Store();
|
||||
import { getSharedStore } from './config';
|
||||
|
||||
const store = getSharedStore();
|
||||
|
||||
/**
|
||||
* 获取设备唯一标识符
|
||||
|
||||
Reference in New Issue
Block a user