aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/mbf/cache.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-04-17 02:06:51 +0900
committerOphestra <cat@gensokyo.uk>2026-04-17 02:06:51 +0900
commita394971dd75d8ad0287197553d3717dfb1d11b74 (patch)
tree49e9f8819a7148d67d2e153c0a7a0eb4bb1fc08d /cmd/mbf/cache.go
parent9daba6080992f7a965873936dc20a85385bbc269 (diff)
cmd/mbf: do not abort cache acquisition during testing
This can sometimes fire during testing due to how short the test is. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/mbf/cache.go')
-rw-r--r--cmd/mbf/cache.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/mbf/cache.go b/cmd/mbf/cache.go
index 16e77cbc..316e303d 100644
--- a/cmd/mbf/cache.go
+++ b/cmd/mbf/cache.go
@@ -4,6 +4,7 @@ import (
"context"
"os"
"path/filepath"
+ "testing"
"hakurei.app/check"
"hakurei.app/internal/pkg"
@@ -53,6 +54,9 @@ func (cache *cache) open() (err error) {
go func() {
select {
case <-cache.ctx.Done():
+ if testing.Testing() {
+ return
+ }
os.Exit(2)
case <-done: