fix: patch all P2 quality/performance issues from project review
- ipc-handlers: withLog extracts actual connection ID from args[0] (P2#20) - updater: add initialized guard to prevent duplicate IPC registration (P2#25) - win-state: log writeFile errors instead of empty callback (P2#26) - format: detectFormat samples up to 4096 chars instead of 100 (P2#28) - commandLogger: add 30+ missing write commands to WRITE_COMMANDS (P2#32) - ReJsonEditor: bind Monaco theme to monacoTheme computed (P2#19) - keys: normalize empty SCAN pattern to '*' (P2#21) - SlowLogView: remove duplicate <style scoped> block (P2#29) - CliView: deduplicate XGROUP in writeCommands Set (P2#33) - key store: use connectionStore instead of IPC for separator (P2#22) - NewConnectionDialog: add visible guard after async watch (P2#30) - KeyList: remove dangerouslyUseHTMLString, use plain text + i18n (P2#31) - KeyList: batch DUMP export with Promise.allSettled (batch=20) (P2#23) - HashEditor: lazy load field TTL on click instead of bulk HTTL (P2#24) - P2#27 already fixed in P0#2; P2#34 is feature (N4); P2#35 not a bug - docs: update PROJECT_REVIEW.md with P2 fix status
This commit is contained in:
@@ -6,14 +6,15 @@ import * as redis from './redis'
|
||||
|
||||
// Helper: wrap handler with command logging
|
||||
function withLog(cmd: string, fn: (...args: any[]) => any) {
|
||||
return async (...args: any[]) => {
|
||||
return async (_e: any, ...args: any[]) => {
|
||||
const start = Date.now()
|
||||
const connId = args[0] || 'unknown'
|
||||
try {
|
||||
const result = await fn(...args)
|
||||
redis.log('current', cmd, Date.now() - start)
|
||||
const result = await fn(_e, ...args)
|
||||
redis.log(connId, cmd, Date.now() - start)
|
||||
return result
|
||||
} catch (err) {
|
||||
redis.log('current', cmd, Date.now() - start)
|
||||
redis.log(connId, cmd, Date.now() - start)
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user