sissbruecker / linkding

Self-hosted bookmark manager that is designed be to be minimal, fast, and easy to set up using Docker.
MIT License
5.32k stars 261 forks source link

Redis support #749

Open vladimirdulov opened 3 weeks ago

vladimirdulov commented 3 weeks ago

Could you implement an ability to use Redis for Huey task queue? Currently Huey task queue uses sqlite3 which doesn't work good in docker environments - a data could be corrupted on container restarts, etc. so it's better to use Redis which supported by huey by default.

https://github.com/coleifer/huey/blob/85f61870e4f5d871d52b941e2e665c14d48408de/docs/django.rst#setting-things-up

Proposed patch of line 180-181 of siteroot/settings/base.py:

https://github.com/sissbruecker/linkding/blob/master/siteroot/settings/base.py#L180

HUEY = {
    'huey_class': os.getenv("LD_REDIS_URL", "") ? 'huey.RedisHuey' : 'huey.SqliteHuey',
    'url': os.getenv("LD_REDIS_URL", ""),
sissbruecker commented 2 weeks ago

Data corruption seems unlikely as long as the container is properly stopped - that should in turn properly shutdown the huey task processor.

I'm not against this, but I probably won't work on it. Contributions for an option would be OK.

As a workaround, you could try mounting a custom.py file into the settings folder, which allows to override any setting such as the HUEY one.