WorkQueue.Messages removed (for now)

This commit is contained in:
Justin Swanson 2019-12-04 23:26:15 -06:00
parent b1ebd3c362
commit a0214d4cbe
2 changed files with 6 additions and 21 deletions

View File

@ -48,12 +48,11 @@ namespace Wabbajack.Common
else if (source.EndsWith(".exe"))
ExtractAllWithInno(source, dest);
else
ExtractAllWith7Zip(queue, source, dest);
ExtractAllWith7Zip(source, dest);
}
catch (Exception ex)
{
queue.Log($"Error while extracting {source}");
throw ex;
Utils.ErrorThrow(ex, $"Error while extracting {source}");
}
}
@ -154,14 +153,13 @@ namespace Wabbajack.Common
}
catch (Exception ex)
{
queue.Log($"While Extracting {source}");
throw ex;
Utils.ErrorThrow(ex, $"While Extracting {source}");
}
}
private static void ExtractAllWith7Zip(WorkQueue queue, string source, string dest)
private static void ExtractAllWith7Zip(string source, string dest)
{
queue.Log(new GenericInfo($"Extracting {Path.GetFileName(source)}", $"The contents of {source} are being extracted to {dest} using 7zip.exe"));
Utils.Log(new GenericInfo($"Extracting {Path.GetFileName(source)}", $"The contents of {source} are being extracted to {dest} using 7zip.exe"));
var info = new ProcessStartInfo
{
@ -210,7 +208,7 @@ namespace Wabbajack.Common
{
return;
}
queue.Log(new _7zipReturnError(p.ExitCode, source, dest, p.StandardOutput.ReadToEnd()));
Utils.Log(new _7zipReturnError(p.ExitCode, source, dest, p.StandardOutput.ReadToEnd()));
}
/// <summary>

View File

@ -22,9 +22,6 @@ namespace Wabbajack.Common
private readonly Subject<CPUStatus> _Status = new Subject<CPUStatus>();
public IObservable<CPUStatus> Status => _Status;
private static readonly Subject<IStatusMessage> _messages = new Subject<IStatusMessage>();
public IObservable<IStatusMessage> Messages => _messages;
public static List<Thread> Threads { get; private set; }
public WorkQueue(int threadCount = 0)
@ -32,16 +29,6 @@ namespace Wabbajack.Common
StartThreads(threadCount == 0 ? Environment.ProcessorCount : threadCount);
}
public void Log(IStatusMessage msg)
{
_messages.OnNext(msg);
}
public void Log(string msg)
{
_messages.OnNext(new GenericInfo(msg));
}
private void StartThreads(int threadCount)
{
ThreadCount = threadCount;