mirror of
https://github.com/krateng/maloja.git
synced 2025-04-13 15:37:13 +03:00
Merge branch 'master' into feature-restructure
This commit is contained in:
commit
d018a758c0
16
.github/workflows/dockerhub.yml
vendored
16
.github/workflows/dockerhub.yml
vendored
@ -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 }}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user