lancachenet / monolithic

A monolithic lancache service capable of caching all CDNs in a single instance
https://hub.docker.com/r/lancachenet/monolithic
Other
725 stars 73 forks source link

Fix wrong deprecation check. #145

Closed reitermarkus closed 2 years ago

reitermarkus commented 2 years ago

CACHE_MEM_SIZE is deprecated, to the if should check if CACHE_MEM_SIZE is set.

Also, setting CACHE_INDEX_SIZE here does not do anything, since this script is executed, not sourced.

VibroAxe commented 2 years ago

@reitermarkus Thanks for looking at this. The deprecation file checks to see if CACHE_MEM_SIZE IS set and then throws the warning to inform a user they should be moving to CACHE_INDEX_SIZE. The reason it's done this way round as CACHE_INDEX_SIZE always exists as it's defaulted through the docker file so you can't do a check for zero on that.

As for the line which does nothing, you are correct but it's part of a plan to simplify how we do deprecation checks later (which has been on my backlog for a while and might now be accelerated to this afternoon after the other script error!)

reitermarkus commented 2 years ago

The deprecation file checks to see if CACHE_MEM_SIZE IS set

@VibroAxe, but it's exactly the other way round currently: It checks if CACHE_INDEX_SIZE IS set when it should be checking CACHE_MEM_SIZE.

VibroAxe commented 2 years ago

So it does, thanks, i've merged this manually in commit https://github.com/lancachenet/monolithic/commit/09ef3314e20f91ab27c6950cf79c94fd0b2e98ee