1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Updated to doreah 0.5.1

This commit is contained in:
Krateng 2019-04-15 12:26:12 +02:00
parent 86d20cc0a8
commit ac3e05a77d
5 changed files with 12 additions and 8 deletions

View File

@ -1,4 +1,4 @@
logging.logfolder = logs
settings.files = [ "settings/default.ini" , "settings/settings.ini" ]
caching.folder = "images/cached/"
caching.folder = "cache/"
regular.autostart = false

3
cache/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*
!.gitignore
!*.info

View File

@ -895,7 +895,7 @@ def sync():
import copy
cache_query = {}
cache_query_permanent = Cache(maxsize=30000)
cache_query_permanent = Cache(maxmemory=1024*1024*settings.get_settings("DB_CACHE_SIZE"),persistent=True,name="dbcache_query")
cacheday = (0,0,0)
def db_query(**kwargs):
check_cache_age()
@ -918,7 +918,7 @@ def db_query(**kwargs):
return result
cache_aggregate = {}
cache_aggregate_permanent = Cache(maxsize=30000)
cache_aggregate_permanent = Cache(maxmemory=1024*1024*settings.get_settings("DB_CACHE_SIZE"),persistent=True,name="dbcache_aggregate")
def db_aggregate(**kwargs):
check_cache_age()
global cache_aggregate, cache_aggregate_permanent

View File

@ -6,12 +6,13 @@ API_PORT = 42011
[Third Party Services]
LASTFM_API_KEY = "ASK" # "ASK" signifies that the user has not yet indicated to not use any key at all.
[Cache]
CACHE_EXPIRE_NEGATIVE = 30 # after how many days negative results should be tried again
CACHE_EXPIRE_POSITIVE = 300 # after how many days positive results should be refreshed
[Database]
DB_CACHE_SIZE = 1024 # how many MB the database cache should have available.
[Local Images]
USE_LOCAL_IMAGES = true

View File

@ -206,8 +206,8 @@ def apirequest(artists=None,artist=None,title=None):
cacheage = settings.get_settings("CACHE_EXPIRE_POSITIVE") * 24 * 3600
cacheage_neg = settings.get_settings("CACHE_EXPIRE_NEGATIVE") * 24 * 3600
artist_cache = caching.Cache.create(name="artist_cache",maxage=cacheage,maxage_negative=cacheage_neg)
track_cache = caching.Cache.create(name="track_cache",maxage=cacheage,maxage_negative=cacheage_neg)
artist_cache = caching.Cache(name="imgcache_artists",maxage=cacheage,maxage_negative=cacheage_neg,persistent=True)
track_cache = caching.Cache(name="imgcache_tracks",maxage=cacheage,maxage_negative=cacheage_neg,persistent=True)
# removes emojis and weird shit from names