-
Notifications
You must be signed in to change notification settings - Fork 3
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
sse adapter approach #50
Conversation
has a couple of rough edges at this point needs further refactoring
… after hook this change was done as part of AGCMD-43, needs to be investigated
…hey can run with a local or Dockerized Mongodb
# Conflicts: # lib/plugin.js
removed a redundant register of schemas on the plugin namespace
refactored adapter.spec.js a bit as well
if (!models[hhSchema.type]) { | ||
|
||
// clean up existing models and schemas | ||
delete mongoose.models[hhSchema.type] | ||
delete mongoose.modelSchemas[hhSchema.type] | ||
//delete db.models[hhSchema.type] |
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.
Not sure why we had to delete them and no longer have to?
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.
removed the commented code in a new commit
the commit message describes why we no longer need this :
removed commented obsoleted code as we no longer have risk of clashes during tests
nowadays we allocate connections with mongoose.createConnection rather than mongoose.connect
models and schemas are scoped to a specific db object and are cleared out and reinstantiated on every test run
… during tests nowadays we allocate connections with mongoose.createConnection rather than mongoose.connect models and schemas are scoped to a specific db object and are cleared out and reinstantiated on every test run
# Conflicts: # lib/plugin.js # lib/sse.js
# Conflicts: # lib/plugin.js # lib/sse.js
…the app developer to specify the options mongodb adapter and adaptersse : had to go back to an approach using vars the whole adapter connect concept needs to be refactored to properly support an immutable approach
This PR refactors the Mongodb specific SSE code into an adapter : adapterSSE. This adapter can be configured with options independent from the regular adapter to tweak settings such as maxPoolSize etc
I also took the opportunity to align the connection handling approach between normal db and oplog operations, and clean up the way the plugin integrates this into it's lifecycle