FoxxMD / context-mod

an event-based, reddit moderation bot built on top of snoowrap and written in typescript
https://contextmod.dev
MIT License
49 stars 11 forks source link

Use redis via env? #37

Closed OmgImAlexis closed 2 years ago

OmgImAlexis commented 2 years ago

Is there an env to use redis? I had assumed PROVIDER_STORE=redis would work.

FoxxMD commented 2 years ago

Kind of. The caching config is tiered to allow operators and subreddits to use different sources, if they want. The entire env approach is geared towards low-barrier, simple, single-subreddit/operator config. I drew the line at caching because I wanted to provide more flexibility for operator/subreddit caching source independence so didn't include much for it in env since its rigid (would require a bunch more keys to configure a single source, and double that to distinguish between operator/subreddit)

You can use process.env.CACHING=redis to set the default cache source for all caching configs that are not defined. However you cannot set host, port, etc. through env. It will try to use a default localhost:6379 connection redis.

If you need to specify those you can do so

OmgImAlexis commented 2 years ago

That makes total sense and exactly what I was expecting.