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

Activity logger plug #2726

Merged
merged 5 commits into from
Jul 1, 2024
Merged

Activity logger plug #2726

merged 5 commits into from
Jul 1, 2024

Conversation

nelsonkopliku
Copy link
Member

Description

This PR adds a Plug that loads the user for the current request and forwards the connection to an ActivityLogger that might or might not be interested in tracking current activity.

Actual implementation of the activity logger to followup.

How was this tested?

Automated tests

@nelsonkopliku nelsonkopliku self-assigned this Jun 28, 2024
@nelsonkopliku nelsonkopliku added enhancement New feature or request user story elixir Pull requests that update Elixir code env Create an ephimeral environment for the pr branch labels Jun 28, 2024
@nelsonkopliku nelsonkopliku force-pushed the activity-logger-plug branch from f05e2c9 to 9630194 Compare July 1, 2024 11:23
Comment on lines +18 to +22
Task.Supervisor.start_child(Trento.TasksSupervisor, fn ->
conn
|> load_user()
|> ActivityLogger.log_activity()
end)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might need to reconsidered at a later point when there is a db based ActivityLogger implementation. (Some sort of bounding of concurrency/back pressure might be necessary.)

@nelsonkopliku nelsonkopliku merged commit 6e1bb6e into main Jul 1, 2024
26 checks passed
@nelsonkopliku nelsonkopliku deleted the activity-logger-plug branch July 1, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
elixir Pull requests that update Elixir code enhancement New feature or request env Create an ephimeral environment for the pr branch user story
Development

Successfully merging this pull request may close these issues.

2 participants