Skip to content

Commit

Permalink
lower mem limit (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
decentralgabe authored Dec 5, 2023
1 parent 9a5a67a commit 2af64d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion impl/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func GetDefaultConfig() Config {
PkarrConfig: PKARRServiceConfig{
RepublishCRON: "0 */2 * * *",
CacheTTLSeconds: 600,
CacheSizeLimitMB: 2000,
CacheSizeLimitMB: 500,
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion impl/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ bootstrap_peers = ["router.magnets.im:6881", "router.bittorrent.com:6881", "dht.
[pkarr]
republish_cron = "0 */2 * * *" # every 2 hours
cache_ttl_seconds = 600 # 10 minutes
cache_size_limit_mb = 2000 # 2GB
cache_size_limit_mb = 500 # 512 MB
3 changes: 2 additions & 1 deletion impl/pkg/service/pkarr.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func (s *PkarrService) PublishPkarr(ctx context.Context, id string, request Publ
if err != nil {
return err
}

if err = s.cache.Set(id, recordBytes); err != nil {
return err
}
Expand Down Expand Up @@ -186,7 +187,7 @@ func (s *PkarrService) GetPkarr(ctx context.Context, id string) (*GetPkarrRespon
logrus.WithError(err).Errorf("failed to set pkarr record[%s] in cache", id)
}
}
return resp, nil
return resp, err
}

// prepare the record for return
Expand Down

0 comments on commit 2af64d8

Please sign in to comment.