No limit on cache size. (#31)

This commit is contained in:
Antonio Navarro Perez 2021-01-13 14:31:46 +01:00 committed by GitHub
parent ae289e99dd
commit 5a6ce96e18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -37,6 +37,9 @@ function CacheChart(id, name) {
this.update = function (used, free) { this.update = function (used, free) {
this._chart.data.datasets.forEach((dataset) => { this._chart.data.datasets.forEach((dataset) => {
dataset.data[0] = used; dataset.data[0] = used;
if (free < 0) {
free = 0;
}
dataset.data[1] = free; dataset.data[1] = free;
}); });

View file

@ -94,7 +94,7 @@ func load(configPath string, port int, fuseAllowOther bool) error {
mountService := fuse.NewHandler(c, ss, fuseAllowOther) mountService := fuse.NewHandler(c, ss, fuseAllowOther)
sigChan := make(chan os.Signal) sigChan := make(chan os.Signal)
signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM) signal.Notify(sigChan, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
go func() { go func() {
<-sigChan <-sigChan

View file

@ -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. # 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. # 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 max-cache-size: 1024
# Folder where distribyted metadata will be stored. # Folder where distribyted metadata will be stored.
metadata-folder-name: ./distribyted-data/metadata metadata-folder-name: ./distribyted-data/metadata
# List of folders where torrents will be mounted as a filesystem. # List of folders where torrents will be mounted as a filesystem.