♻️ Rebuilt cache with nexus cache

This commit is contained in:
2025-03-29 15:48:04 +08:00
parent 1390f26afa
commit 073b32aa73
7 changed files with 99 additions and 574 deletions

View File

@@ -2,16 +2,22 @@ package gap
import (
"fmt"
"strings"
"time"
"git.solsynth.dev/hypernet/nexus/pkg/nex"
"git.solsynth.dev/hypernet/nexus/pkg/nex/cachekit"
"git.solsynth.dev/hypernet/nexus/pkg/proto"
"github.com/rs/zerolog/log"
"github.com/samber/lo"
"strings"
"github.com/spf13/viper"
)
var Nx *nex.Conn
var (
Nx *nex.Conn
Ca *cachekit.Conn
)
func InitializeToNexus() error {
grpcBind := strings.SplitN(viper.GetString("grpc_bind"), ":", 2)
@@ -39,5 +45,9 @@ func InitializeToNexus() error {
}()
}
if Ca, err = cachekit.NewConn(Nx, 3*time.Second); err != nil {
return fmt.Errorf("failed to create cachekit connection: %v", err)
}
return err
}