diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 16a4197..f20b655 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -41,11 +41,11 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} -# skipping this until https://github.com/peter-evans/dockerhub-description/issues/10 is fixed -# - name: Update Readme and short description -# uses: peter-evans/dockerhub-description@616d1b63e806b630b975af3b4fe3304307b20f40 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} -# repository: krateng/maloja -# short-description: ${{ github.event.repository.description }} + - name: Update Readme and short description + uses: peter-evans/dockerhub-description@1cf9afbac3c5d2fdc66416a464c2c38260cb6f8d + continue-on-error: true + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} + repository: krateng/maloja + short-description: ${{ github.event.repository.description }} diff --git a/README.md b/README.md index 1c7b9cd..ae4c17c 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ To backup your data, run `maloja backup`, optional with `--include_images`. ## How to scrobble -You can set up any amount of API keys in the file `authenticated_machines.tsv` in the `/etc/maloja/clients` folder. It is recommended to define a different API key for every scrobbler you use. +You can set up any amount of API keys in the file `apikeys.yml` in your configuration folder (or via the web interface). It is recommended to define a different API key for every scrobbler you use. ### Native support diff --git a/maloja/__pkginfo__.py b/maloja/__pkginfo__.py index b8da361..f772f7e 100644 --- a/maloja/__pkginfo__.py +++ b/maloja/__pkginfo__.py @@ -4,7 +4,7 @@ # you know what f*ck it # this is hardcoded for now because of that damn project / package name discrepancy # i'll fix it one day -VERSION = "3.0.0-beta.4" +VERSION = "3.0.0" HOMEPAGE = "https://github.com/krateng/maloja" diff --git a/maloja/database/dbcache.py b/maloja/database/dbcache.py index 1b35994..c31d130 100644 --- a/maloja/database/dbcache.py +++ b/maloja/database/dbcache.py @@ -11,9 +11,12 @@ from doreah.logging import log from ..pkg_global.conf import malojaconfig HIGH_NUMBER = 1000000 +CACHE_SIZE = 10000 +ENTITY_CACHE_SIZE = 1000000 +CACHE_ADJUST_STEP = 100 -cache = lru.LRU(HIGH_NUMBER) -entitycache = lru.LRU(HIGH_NUMBER) +cache = lru.LRU(CACHE_SIZE) +entitycache = lru.LRU(ENTITY_CACHE_SIZE) hits, misses = 0, 0 @@ -111,12 +114,18 @@ def invalidate_entity_cache(): def trim_cache(): ramprct = psutil.virtual_memory().percent if ramprct > malojaconfig["DB_MAX_MEMORY"]: - log(f"{ramprct}% RAM usage, reducing caches!") - ratio = 0.6 - targetsize = max(int(len(cache) * ratio),100) - cache.set_size(targetsize) - cache.set_size(HIGH_NUMBER) - log(f"New RAM usage: {psutil.virtual_memory().percent}%") + log(f"{ramprct}% RAM usage, clearing cache and adjusting size!") + #ratio = 0.6 + #targetsize = max(int(len(cache) * ratio),50) + #log(f"Reducing to {targetsize} entries") + #cache.set_size(targetsize) + #cache.set_size(HIGH_NUMBER) + cache.clear() + if cache.get_size() > CACHE_ADJUST_STEP: + cache.set_size(cache.get_size() - CACHE_ADJUST_STEP) + + #log(f"New RAM usage: {psutil.virtual_memory().percent}%") + print_stats() diff --git a/pyproject.toml b/pyproject.toml index fa553b7..a007378 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "malojaserver" -version = "3.0.0-beta.4" +version = "3.0.0" description = "Self-hosted music scrobble database" readme = "./README.md" requires-python = ">=3.6" @@ -21,7 +21,7 @@ classifiers = [ dependencies = [ "bottle>=0.12.16", "waitress>=1.3", - "doreah>=1.8.1, <2", + "doreah>=1.9.0, <2", "nimrodel>=0.8.0", "setproctitle>=1.1.10", #"pyvips>=2.1.16", diff --git a/requirements.txt b/requirements.txt index 1d97c23..60aceb1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ bottle>=0.12.16 waitress>=1.3 -doreah>=1.8.1, <2 +doreah>=1.9.0, <2 nimrodel>=0.8.0 setproctitle>=1.1.10 jinja2>=2.11