-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow disabling redis #785
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This needs to be rebased, I think the upstream branch has seen a force-push since this was created, and now this PR seems to include @hmpf's old commits.
- While disabling Redis might be fine in a development environment, this setting needs to come with a big fat warning that it is not suitable for production use. In-memory channels are single-process only, and that's not how you would deploy the Argus in any production setting.
What @lunkwill42 is probably trying to say is that you need to document the setting where the other settings are in the docs, and maybe only turn it on if DEBUG is also on. after rebasing :) I should really write that "how to merge"-doc... |
02d1e6d
to
ab91dc4
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #785 +/- ##
==========================================
+ Coverage 81.93% 82.45% +0.51%
==========================================
Files 132 132
Lines 4861 4867 +6
==========================================
+ Hits 3983 4013 +30
+ Misses 878 854 -24 ☔ View full report in Codecov by Sentry. |
Quality Gate passedIssues Measures |
I've limited the flag only when debug is also set, but this doesn't work if debug is managed statically in a different file. Consider the following: For security reasons, |
If I'm reading #630 correctly, the mechanism it introduces will also use Redis for conveying messages about notifications to the new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think moving this to the dev settings file maybe makes the most sense.
Hmm...
8809dcc
to
b870827
Compare
b870827
to
5a6b8c1
Compare
Quality Gate passedIssues Measures |
@@ -323,7 +323,7 @@ Ticket system settings | |||
``TICKET_PLUGIN``, ``TICKET_ENDPOINT``, ``TICKET_AUTHENTICATION_SECRET``, | |||
``TICKET_INFORMATION`` are all described in :ref:`ticket-systems-settings`. | |||
|
|||
Debugging settings | |||
Development settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The underline is too short, sphinx will croak.
|
||
* :setting:`ARGUS_DISABLE_REDIS` When given as an environment variable, this switches out the | ||
depencendy of django channels on Redis with an InMemoryChannelLayer. This can only be done | ||
in development (using the dev.py settings). Overriding this setting in a custom settings file has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smart.
# fmt: off | ||
_REDIS = urlsplit("//" + get_str_env("ARGUS_REDIS_SERVER", "127.0.0.1:6379")) | ||
CHANNEL_LAYERS = { | ||
"default": { | ||
"BACKEND": "channels_redis.core.RedisChannelLayer", | ||
"CONFIG": { | ||
"hosts": [(_REDIS.hostname, _REDIS.port or 6379)], | ||
}, | ||
}, | ||
} | ||
# fmt: on | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This turns redis off for all production though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could move this to the "backend" settings, or "spa" since the old frontend needs it.
Add a boolean environment variable "ARGUS_DISABLE_REDIS" that, when set, will tell channels to use an InMemoryChannel instead of Redis so that we may run the backend without having a redis server running