Skip to content

Commit 9f0bbd8

Browse files
committed
Delay update check to avoid blocking plugin init
The checkForUpdates call was running immediately on plugin load, which could slow down startup. Moving it to a 5-second timeout ensures the plugin initializes quickly while still checking for updates in the background.
1 parent 3d27337 commit 9f0bbd8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ const plugin: Plugin = (async (ctx) => {
127127
model: config.model || "auto"
128128
})
129129

130-
checkForUpdates(ctx.client, logger).catch(() => { })
130+
setTimeout(() => {
131+
checkForUpdates(ctx.client, logger).catch(() => { })
132+
}, 5000)
131133

132134
if (migrations.length > 0) {
133135
setTimeout(async () => {

0 commit comments

Comments
 (0)