ability to disable http and/or event consumer for user log service - #3285
ability to disable http and/or event consumer for user log service#3285maki5 wants to merge 4 commits into
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 19 |
| Duplication | -102 |
🟢 Coverage 0.80% diff coverage · -0.04% coverage variation
Metric Results Coverage variation ✅ -0.04% coverage variation (-1.00%) Diff coverage ✅ 0.80% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (c8a1f55) 84104 19347 23.00% Head commit (fb8d211) 84148 (+44) 19327 (-20) 22.97% (-0.04%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#3285) 125 1 0.80% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
…erlog_event_handler_on_demand
…erlog_event_handler_on_demand
butonic
left a comment
There was a problem hiding this comment.
the pkg/service package now implements both:
- service.go contains event processing that stores events in nats + publishes sse events
- http.go implements the http handler that reads from nats.
In the activitylog PR I extracted an activitylog service that wraps the nats kv store with the business logic to add and remove events. It is injected into the http service and the events service (but I like your name 'consumer' better).
I know this is more work, but I think we should seperate the implementation aspects. AFAICT the http service then does not need the event stream at all, so we only need to initiate it for the consumer (hm, it also publishes sse events, so maybe events is a better name in this case).
for user log service it's possible now to disable/enable from config