Skip to content
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

(refactor) Ensure Redis Pub/Sub can be turned off via production flag #948

Closed
jniles opened this issue Nov 27, 2016 · 0 comments
Closed
Assignees
Labels

Comments

@jniles
Copy link
Collaborator

jniles commented Nov 27, 2016

As we are deploying in production, our Redis events will not be used. To be more efficient, we should add a feature to turn Topic off completely via a build flag. This would add a noop function for all Topic API calls, to ensure that no other code needs to be changed.

Advantages:

  1. V8 can better optimize the server code by detecting dead code and routing around it.
  2. No need to have a complex Redis-Node interaction in the Event Loop if it is not used.
  3. Database does not record events when they are not used.

@IMA-WorldHealth/bhima-core What do you think?

@jniles jniles added this to the Future milestone Nov 27, 2016
@jniles jniles self-assigned this Feb 16, 2017
jniles pushed a commit to jniles/bhima that referenced this issue Feb 19, 2017
This commit adds environmental variable control of the events emitted by
Topic.  By setting the variable `DISABLE_EVENTS` to false, no Redis
subscriptions will be made at runtime.  In fact, the code is read as
dead code and returns immediately on entry into the function.

Closes IMA-WorldHealth#948.
@jniles jniles mentioned this issue Feb 19, 2017
4 tasks
jniles pushed a commit that referenced this issue Feb 19, 2017
This commit adds environmental variable control of the events emitted by
Topic.  By setting the variable `DISABLE_EVENTS` to false, no Redis
subscriptions will be made at runtime.  In fact, the code is read as
dead code and returns immediately on entry into the function.

Closes #948.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant