Reduce database connnections required for routes::users::details #888

Closed
opened 6 months ago by KitaitiMakoto · 0 comments
Owner

routes::users::detals() requires many DbConn. Its function signature requires a DbConn and three PlumeRockets, which has DbConn as a field. Additionally, other DbConns are retrieved in internal functions.

This occurs 503 error on proceeding, especially in the case of low database connection limit.

To fix this issue, we need to:

  1. Extract DbConn from PlumeRocket as said at #797 and tried at #805 I gave up. See #889.
  2. Change method signature of implementations of FromIds. ctx argument of from_id, from_activity and from_db should be a database connection instead of PlumeRocket (definition of FromId trait itself need not change)
  3. Share database pool with SearchActor (or remove dependency on database connection from SearchActor)
  4. Extract thread worker tasks in routes::users::details() as an actor's method, such that holds DbPool and retrieves DbConn on demand
`routes::users::detals()` requires many `DbConn`. Its function signature requires a `DbConn` and three `PlumeRocket`s, which has `DbConn` as a field. Additionally, other `DbConn`s are retrieved in internal functions. This occurs 503 error on proceeding, especially in the case of low database connection limit. To fix this issue, we need to: 1. [ ] ~~Extract `DbConn` from `PlumeRocket` as said at #797 and tried at #805~~ I gave up. See #889. 2. [x] Change method signature of implementations of `FromId`s. `ctx` argument of `from_id`, `from_activity` and `from_db` should be a database connection instead of `PlumeRocket` (definition of `FromId` trait itself need not change) 3. [x] Share database pool with `SearchActor` (or remove dependency on database connection from `SearchActor`) 4. [x] Extract thread worker tasks in `routes::users::details()` as an actor's method, such that holds `DbPool` and retrieves `DbConn` on demand
KitaitiMakoto added this to the 0.7.0 milestone 6 months ago
KitaitiMakoto closed this issue 6 months ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.