Fix: cache kv db should not block on init
This commit is contained in:
parent
b9d470cf79
commit
66cb0b1218
1 changed files with 2 additions and 1 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/Dreamacro/clash/component/profile"
|
"github.com/Dreamacro/clash/component/profile"
|
||||||
C "github.com/Dreamacro/clash/constant"
|
C "github.com/Dreamacro/clash/constant"
|
||||||
|
@ -78,7 +79,7 @@ func (c *CacheFile) Close() error {
|
||||||
// TODO: remove migrateCache until 2022
|
// TODO: remove migrateCache until 2022
|
||||||
func migrateCache() {
|
func migrateCache() {
|
||||||
defer func() {
|
defer func() {
|
||||||
db, err := bolt.Open(C.Path.Cache(), fileMode, nil)
|
db, err := bolt.Open(C.Path.Cache(), fileMode, &bolt.Options{Timeout: time.Second})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnln("[CacheFile] can't open cache file: %s", err.Error())
|
log.Warnln("[CacheFile] can't open cache file: %s", err.Error())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue