From 5a6ce96e185fba7bdd30daaf5fd34a468e221d2b Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Wed, 13 Jan 2021 14:31:46 +0100 Subject: [PATCH] No limit on cache size. (#31) --- assets/js/cache_chart.js | 3 +++ cmd/distribyted/main.go | 2 +- templates/config_template.yaml | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/assets/js/cache_chart.js b/assets/js/cache_chart.js index 41d09f0..6c63a0e 100644 --- a/assets/js/cache_chart.js +++ b/assets/js/cache_chart.js @@ -37,6 +37,9 @@ function CacheChart(id, name) { this.update = function (used, free) { this._chart.data.datasets.forEach((dataset) => { dataset.data[0] = used; + if (free < 0) { + free = 0; + } dataset.data[1] = free; }); diff --git a/cmd/distribyted/main.go b/cmd/distribyted/main.go index 102d901..d9d7180 100644 --- a/cmd/distribyted/main.go +++ b/cmd/distribyted/main.go @@ -94,7 +94,7 @@ func load(configPath string, port int, fuseAllowOther bool) error { mountService := fuse.NewHandler(c, ss, fuseAllowOther) sigChan := make(chan os.Signal) - signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM) + signal.Notify(sigChan, os.Interrupt, syscall.SIGINT, syscall.SIGTERM) go func() { <-sigChan diff --git a/templates/config_template.yaml b/templates/config_template.yaml index c7633d5..31825d7 100644 --- a/templates/config_template.yaml +++ b/templates/config_template.yaml @@ -1,7 +1,9 @@ # This is a configuration file example. You can edit it and add and remove torrents and magnet URIs. Read the following comments for more info. # Size in MB for the cache. This is the maximum space used by distribyted to store torrent data. Less used torrent data will be discarded if this value is reached. +# max-cache-size: -1 #No limit max-cache-size: 1024 + # Folder where distribyted metadata will be stored. metadata-folder-name: ./distribyted-data/metadata # List of folders where torrents will be mounted as a filesystem.