Fix: slow startup from silly migrations

This commit is contained in:
Grail Finder
2026-03-13 10:18:31 +03:00
parent d9b820c9c4
commit 648035b194
6 changed files with 163 additions and 103 deletions

28
bot.go
View File

@@ -1529,21 +1529,23 @@ func init() {
asr = NewSTT(logger, cfg)
}
if cfg.PlaywrightEnabled {
if err := checkPlaywright(); err != nil {
// slow, need a faster check if playwright install
if err := installPW(); err != nil {
logger.Error("failed to install playwright", "error", err)
cancel()
os.Exit(1)
return
}
go func() {
if err := checkPlaywright(); err != nil {
logger.Error("failed to run playwright", "error", err)
cancel()
os.Exit(1)
return
// slow, need a faster check if playwright install
if err := installPW(); err != nil {
logger.Error("failed to install playwright", "error", err)
cancel()
os.Exit(1)
return
}
if err := checkPlaywright(); err != nil {
logger.Error("failed to run playwright", "error", err)
cancel()
os.Exit(1)
return
}
}
}
}()
}
// atomic default values
cachedModelColor.Store("orange")