-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix Reporting Service #2218
Fix Reporting Service #2218
Conversation
@@ -217,7 +217,7 @@ public async Task<IActionResult> SendToAsync(int id, string to) | |||
var username = User.GetUsername() ?? throw new NotAuthorizedException("Username is missing"); | |||
var user = _userService.FindByUsername(username) ?? throw new NotAuthorizedException($"User [{username}] does not exist"); | |||
|
|||
var request = new ReportRequestModel(ReportDestination.ReportingService, Entities.ReportType.Content, report.Id, new { }) | |||
var request = new ReportRequestModel(ReportDestination.ReportingService, Entities.ReportType.Content, report.Id, JsonDocument.Parse("{}")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to change to JsonDocument because it was being used inconsistently with a dynamic object.
JsonValueKind.String => !typeof(T).IsEnum ? | ||
(T)Convert.ChangeType($"{node.GetString()}".Trim(), typeof(T)) : | ||
(T)Enum.Parse(typeof(T), node.GetString() ?? ""), | ||
JsonValueKind.String => ((Func<T?>)(() => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed parsing issue with nullable enum values
/// Get the preferred email if it has been set. | ||
/// </summary> | ||
/// <returns></returns> | ||
public string[] GetEmails() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed
@@ -182,7 +182,7 @@ public override async Task RunAsync() | |||
// Reached limit return to ingest manager, send email. | |||
if (manager.Ingest.FailedAttempts >= manager.Ingest.RetryLimit) | |||
{ | |||
await this.SendEmailAsync($"Ingest [{ingest.Name}] failed. Reached [{manager.Ingest.RetryLimit}] maximum retries.", ex); | |||
await this.SendErrorEmailAsync($"Ingest [{ingest.Name}] failed. Reached [{manager.Ingest.RetryLimit}] maximum retries.", ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed method to make it clear
@@ -7,5 +7,5 @@ public enum ReportingErrors | |||
FailedToAddInstance = 2, | |||
FailedToUpdateInstance = 3, | |||
FailedToGenerateOutput = 4, | |||
FailedToEmail = 4, | |||
FailedToEmail = 5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed enum bug
The Reporting Service can now be configured to resend on failures, and whether it will attempt to send the report to every subscriber before it logs the report send as a failure. This provides a way to get a report out to subscribers when only a single subscriber's email is failing.
Summary
Reporting Service Configuration Options