more efficient caching
This commit is contained in:
@@ -13,19 +13,19 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
c, cErr := config.LoadZurgConfig("./config.yml")
|
||||
if cErr != nil {
|
||||
log.Panicf("Config failed to load: %v", cErr)
|
||||
config, configErr := config.LoadZurgConfig("./config.yml")
|
||||
if configErr != nil {
|
||||
log.Panicf("Config failed to load: %v", configErr)
|
||||
}
|
||||
|
||||
t := torrent.NewTorrentManager(c)
|
||||
|
||||
cache := expirable.NewLRU[string, string](1e4, nil, time.Hour)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
dav.Router(mux, c, t, cache)
|
||||
t := torrent.NewTorrentManager(config, cache)
|
||||
|
||||
addr := fmt.Sprintf(":%s", c.GetPort())
|
||||
mux := http.NewServeMux()
|
||||
dav.Router(mux, config, t, cache)
|
||||
|
||||
addr := fmt.Sprintf(":%s", config.GetPort())
|
||||
log.Printf("Starting server on %s\n", addr)
|
||||
err := http.ListenAndServe(addr, mux)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user