Skip to content

Commit 7d159a8

Browse files
committed
fix: 修复插件统计调用0 fixes #7
1 parent a5b2b2d commit 7d159a8

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
"karin": "karin"
3131
},
3232
"devDependencies": {
33-
"@types/node": "^20.17.17",
34-
"eslint": "^9.20.0",
33+
"@types/node": "^20.17.30",
34+
"eslint": "^9.24.0",
3535
"neostandard": "^0.12.1",
36-
"node-karin": "^1.4.3",
37-
"tsup": "^8.3.6",
38-
"tsx": "^4.19.2",
39-
"typescript": "^5.7.3"
36+
"node-karin": "^1.7.14",
37+
"tsup": "^8.4.0",
38+
"tsx": "^4.19.3",
39+
"typescript": "^5.8.3"
4040
},
4141
"publishConfig": {
4242
"access": "public",

src/apps/status.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,11 @@ const uptime = () => {
9797
}
9898
})
9999

100-
// karin.on(EVENT_COUNT, ({ plugin, event }) => {
101-
// const key = `${EVENT_COUNT}:${moment().format('YYYY-MM-DD')}:${plugin.file.basename}:${plugin.file.method}`
102-
// redis.incr(key)
103-
// })
100+
hooks.eventCall((e, _, next) => {
101+
try {
102+
redis.incr(`${EVENT_COUNT}:${createKey(e.contact)}`)
103+
} finally {
104+
next()
105+
}
106+
})
104107
})()

0 commit comments

Comments
 (0)