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

Minor fixes to ActivityManager #3784

Merged
merged 1 commit into from Aug 5, 2020
Merged

Conversation

barronpm
Copy link
Member

@barronpm barronpm commented Aug 1, 2020

Changes
Uses synchronous Add() and asynchronous context creation.

@@ -40,8 +40,9 @@ public void Create(ActivityLog entry)
/// <inheritdoc/>
public async Task CreateAsync(ActivityLog entry)
{
using var dbContext = _provider.CreateContext();
await dbContext.ActivityLogs.AddAsync(entry);
await using var dbContext = _provider.CreateContext();
Copy link
Member

Choose a reason for hiding this comment

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

@Bond-009 What about ConfigureAwait here?

Copy link
Member

Choose a reason for hiding this comment

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

Good point.
Should be done like this:

var dbContext = _provider.CreateContext();
await using dbContext.ConfigureAwait(false);

Copy link
Member Author

Choose a reason for hiding this comment

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

That doesn't compile

Copy link
Member

Choose a reason for hiding this comment

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

@anthonylavado anthonylavado merged commit c2799fe into jellyfin:master Aug 5, 2020
@barronpm barronpm deleted the add-sync branch August 8, 2020 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants