Merge branch 'develop'
* develop: Fixed an error which caused null pointer exceptions in discord framework and interrupted the scanning queue permanently Changed message count to acutally count scanned messages even if they already have scanned before Contine on exception during scanning
This commit is contained in:
commit
bea7715599
|
@ -74,7 +74,8 @@ namespace DML.AppCore.Classes
|
|||
var channel = FindChannelById(guild, ChannelId);
|
||||
|
||||
Debug("Checking channel access");
|
||||
if (!channel.Users.Contains(channel.Guild.CurrentUser))
|
||||
//channel.GetUser(channel.Guild.CurrentUser.Id);
|
||||
if (channel.GetUser(channel.Guild.CurrentUser.Id) == null)
|
||||
{
|
||||
Info("Skipping channel without access");
|
||||
return result;
|
||||
|
@ -126,6 +127,8 @@ namespace DML.AppCore.Classes
|
|||
if (!IsValid)
|
||||
return null;
|
||||
|
||||
Core.Scheduler.MessagesScanned++;
|
||||
|
||||
Debug($"Processing message {m.Id}");
|
||||
if (m.Id < lastId)
|
||||
{
|
||||
|
@ -148,8 +151,6 @@ namespace DML.AppCore.Classes
|
|||
Trace($"Added message {m.Id}");
|
||||
}
|
||||
Debug($"Finished message {m.Id}");
|
||||
|
||||
Core.Scheduler.MessagesScanned++;
|
||||
}
|
||||
|
||||
finished = finished || messages.Count < limit;
|
||||
|
|
|
@ -90,6 +90,8 @@ namespace DML.AppCore.Classes
|
|||
{
|
||||
Logger.Info("Started JobScheduler...");
|
||||
while (Run)
|
||||
{
|
||||
try
|
||||
{
|
||||
Logger.Debug("Entering job list handler loop...");
|
||||
//foreach (var job in JobList)
|
||||
|
@ -144,7 +146,8 @@ namespace DML.AppCore.Classes
|
|||
Logger.Trace("Locking scheduler...");
|
||||
lock (this)
|
||||
{
|
||||
Logger.Trace($"Checking thread limit. Running: {RunningThreads}, Max: {Core.Settings.ThreadLimit}");
|
||||
Logger.Trace(
|
||||
$"Checking thread limit. Running: {RunningThreads}, Max: {Core.Settings.ThreadLimit}");
|
||||
if (RunningThreads >= Core.Settings.ThreadLimit)
|
||||
continue;
|
||||
|
||||
|
@ -159,6 +162,11 @@ namespace DML.AppCore.Classes
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error(ex.Message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue