Skip to content

Refactor mongo store handling

André Sterba requested to merge refactor-mongo-store-handling into master

Description

This MR removes the connection handling from the database store implementions. Instead we connect a single time in the controller.go to the mongo database and reuse that connection in all stores.

It also adds context handling to the store layer. Currently the context is created in the service layer, but this should be moved to northbound to use the same context through the whole call stack. (will be done in another MR soon)

Motivation and Context

This change removes code duplication in all mongo store implementations.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
Edited by André Sterba

Merge request reports