Skip to content

Commit

Permalink
feat: logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Thundernerd committed Feb 27, 2024
1 parent a94c827 commit 1b99435
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CalculatePlayerPointsJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ public class CalculatePlayerPointsJob : IJob
};

private readonly GTRContext db;
private readonly ILogger<CalculatePlayerPointsJob> _logger;

public CalculatePlayerPointsJob(GTRContext db)
public CalculatePlayerPointsJob(GTRContext db, ILogger<CalculatePlayerPointsJob> logger)
{
this.db = db;
_logger = logger;
}

public async Task Execute(IJobExecutionContext context)
Expand Down Expand Up @@ -94,6 +96,7 @@ public async Task Execute(IJobExecutionContext context)
}
}

await db.SaveChangesAsync(context.CancellationToken);
int saveChangesAsync = await db.SaveChangesAsync(context.CancellationToken);
_logger.LogInformation("Saved {Count} changes", saveChangesAsync);
}
}

0 comments on commit 1b99435

Please sign in to comment.