Skip to content
Permalink
Browse files

Hopefully fix the hard crash when files are touched while scanning

  • Loading branch information...
da3dsoul committed Sep 27, 2019
1 parent a11a155 commit 1ab3d7debfac7efb4117f66feff28e3dafe904f7
Showing with 20 additions and 1 deletion.
  1. +20 −1 Shoko.Server/ShokoServer.cs
@@ -488,7 +488,17 @@ void WorkerFileEvents_RunWorkerCompleted(object sender, RunWorkerCompletedEventA
void WorkerFileEvents_DoWork(object sender, DoWorkEventArgs e)
{
logger.Info("Started thread for processing file events");
foreach (FileSystemEventArgs evt in queueFileEvents)
FileSystemEventArgs evt;
try
{
evt = queueFileEvents.GetNextItem();
}
catch (Exception exception)
{
logger.Error(exception);
evt = null;
}
while(evt != null)
{
try
{
@@ -545,6 +555,15 @@ void WorkerFileEvents_DoWork(object sender, DoWorkEventArgs e)
}
}
queueFileEvents.Remove(evt);
try
{
evt = queueFileEvents.GetNextItem();
}
catch (Exception exception)
{
logger.Error(exception);
evt = null;
}
}
catch (Exception ex)
{

0 comments on commit 1ab3d7d

Please sign in to comment.
You can’t perform that action at this time.