mosquito-cr / mosquito

A background task runner for crystal applications supporting periodic (CRON) and manually queued jobs
MIT License
227 stars 24 forks source link

Add a MOSQUITO_REDIS_URL Env Variable by default #39

Closed elaine-jackson closed 4 years ago

elaine-jackson commented 5 years ago

The default REDIS_URL might be used by conflicting dependencies, or a app may wish to have a dedicated instance for background jobs. This pull request changes mosquito's behavior to check for a "MOSQUITO_REDIS_URL" ENV Var before using the "REDIS_URL" ENV Var.

robacarp commented 5 years ago

Hi @nsuchy thanks for the pull request. Ideally I'd like to ditch the magic URL altogether, as indicated by #3. What do you think about that?

elaine-jackson commented 5 years ago

Hi @nsuchy thanks for the pull request. Ideally I'd like to ditch the magic URL altogether, as indicated by #3. What do you think about that?

You're suggesting we create a config file / initializer system instead?

elaine-jackson commented 5 years ago

Fixed a syntax error in this pull request. I think a good answer to this question starts at whether we have a lot of options in configuration. Right now Mosquito is super simple background task runner. If it gets more features maybe a configuration file will be necessary. I think environment variables are enough for the time being.

elaine-jackson commented 5 years ago

Currently this change looks like it'll require us to use Mosquito.Base.settings.redis_url unless I'm misunderstanding something.