From a12ba060f5fb01d5989e23f3797ae7533bda2a04 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 29 Mar 2025 16:01:20 +0800 Subject: [PATCH] :arrow_up: Upgrade nexus to fix panic --- go.mod | 2 +- go.sum | 2 ++ pkg/internal/cache/store.go | 24 ------------------------ pkg/main.go | 6 ------ 4 files changed, 3 insertions(+), 31 deletions(-) delete mode 100644 pkg/internal/cache/store.go diff --git a/go.mod b/go.mod index 0ef9815..297d7da 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.solsynth.dev/hypernet/paperclip go 1.23.2 require ( - git.solsynth.dev/hypernet/nexus v0.0.0-20250329072729-4a08fd8f1c46 + git.solsynth.dev/hypernet/nexus v0.0.0-20250329075932-d5422ab5b04c git.solsynth.dev/hypernet/passport v0.0.0-20250315083747-32e91e26013c git.solsynth.dev/hypernet/wallet v0.0.0-20250323095812-468cd655f886 github.com/barasher/go-exiftool v1.10.0 diff --git a/go.sum b/go.sum index dcdb9a5..5ae7e2a 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= git.solsynth.dev/hypernet/nexus v0.0.0-20250329072729-4a08fd8f1c46 h1:oH2jq7ZG5cslCULUMWqv4dS/YNvd+Xcuv4rBPj0uGA8= git.solsynth.dev/hypernet/nexus v0.0.0-20250329072729-4a08fd8f1c46/go.mod h1:5tk62VQ1DcbR0EAN2jAOqYxHiegUPEC805JlfQ/G19I= +git.solsynth.dev/hypernet/nexus v0.0.0-20250329075932-d5422ab5b04c h1:XgdTgJxSAQuCbiG15hN5pY6chzcz8sX3Onm2itS+Ufs= +git.solsynth.dev/hypernet/nexus v0.0.0-20250329075932-d5422ab5b04c/go.mod h1:5tk62VQ1DcbR0EAN2jAOqYxHiegUPEC805JlfQ/G19I= git.solsynth.dev/hypernet/passport v0.0.0-20250315083747-32e91e26013c h1:XB8EBX34WB2skmjaVFot5IlxKF2qFZ2SueG/Y9SiJ6Y= git.solsynth.dev/hypernet/passport v0.0.0-20250315083747-32e91e26013c/go.mod h1:k7MZQWYBpxlk3g9bx0HTh5C3m+MG/wr0hAiRM/VyAqs= git.solsynth.dev/hypernet/pusher v0.0.0-20250216145944-5fb769823a88 h1:2HEENe9KUrdaJeNBzx9lsuXQGyzWqCgnLTKQnr8xFr8= diff --git a/pkg/internal/cache/store.go b/pkg/internal/cache/store.go deleted file mode 100644 index 592b544..0000000 --- a/pkg/internal/cache/store.go +++ /dev/null @@ -1,24 +0,0 @@ -package cache - -import ( - "github.com/dgraph-io/ristretto" - "github.com/eko/gocache/lib/v4/store" - ristrettoCache "github.com/eko/gocache/store/ristretto/v4" -) - -var S store.StoreInterface - -func NewStore() error { - ristretto, err := ristretto.NewCache(&ristretto.Config{ - NumCounters: 1000, - MaxCost: 100, - BufferItems: 64, - }) - if err != nil { - return err - } - - S = ristrettoCache.NewRistretto(ristretto) - - return nil -} diff --git a/pkg/main.go b/pkg/main.go index bd59b94..4bd441b 100644 --- a/pkg/main.go +++ b/pkg/main.go @@ -12,7 +12,6 @@ import ( "git.solsynth.dev/hypernet/paperclip/pkg/internal/gap" "github.com/fatih/color" - "git.solsynth.dev/hypernet/paperclip/pkg/internal/cache" "git.solsynth.dev/hypernet/paperclip/pkg/internal/database" "git.solsynth.dev/hypernet/paperclip/pkg/internal/grpc" @@ -68,11 +67,6 @@ func main() { log.Fatal().Err(err).Msg("An error occurred when running database auto migration.") } - // Initialize cache - if err := cache.NewStore(); err != nil { - log.Fatal().Err(err).Msg("An error occurred when initializing cache.") - } - // Set up some workers for idx := 0; idx < viper.GetInt("workers.files_analyze"); idx++ { go services.StartConsumeAnalyzeTask()