Features/discord logging (#18)
* Had the wrong flag for rss enabled * Adding more logging for discord.
This commit is contained in:
parent
1bc9b8d842
commit
f1f0e50098
@ -14,7 +14,7 @@ public static class BackgroundJobs
|
||||
{
|
||||
ConnectionString = configuration.GetValue<string>(ConfigConst.ConnectionStringDatabase),
|
||||
OpenTelemetry = configuration.GetValue<string>(ConfigConst.ConnectionStringOpenTelemetry),
|
||||
IsEnabled = configuration.GetValue<bool>(ConfigConst.RedditIsEnabled)
|
||||
IsEnabled = configuration.GetValue<bool>(ConfigConst.RssIsEnabled)
|
||||
}), "15 0-23 * * *");
|
||||
|
||||
RecurringJob.AddOrUpdate<DiscordNotificationJob>("Discord Alerts", x =>
|
||||
|
@ -73,7 +73,7 @@ public class DiscordNotificationJob
|
||||
var sourceDetails = _sources.GetByID(articleDetails.SourceID);
|
||||
if (sourceDetails.ID == Guid.Empty)
|
||||
{
|
||||
_logger.Error($"{JobName} - Article ({articleDetails.ID}) was linked to a empty Source ID. Removing from the queue");
|
||||
_logger.Error($"{JobName} - Article ({articleDetails.ID}) was linked to a empty Source ID. Removing from the queue.");
|
||||
_queue.Delete(request.ID);
|
||||
continue;
|
||||
}
|
||||
@ -109,8 +109,10 @@ public class DiscordNotificationJob
|
||||
Thread.Sleep(3000);
|
||||
}
|
||||
|
||||
_logger.Debug($"{JobName} - Removing {request.ID} from the queue.");
|
||||
_queue.Delete(request.ID);
|
||||
}
|
||||
_logger.Error($"{JobName} - Loop has been completed.");
|
||||
}
|
||||
|
||||
public DiscordMessage GenerateDiscordMessage(SourceModel source, ArticlesModel article, IconModel icon)
|
||||
|
Loading…
Reference in New Issue
Block a user