More useful logging
This commit is contained in:
parent
0ff8da2cf0
commit
c9e850515e
@ -221,6 +221,7 @@ namespace AaxDecrypter
|
|||||||
var buff = new byte[DOWNLOAD_BUFF_SZ];
|
var buff = new byte[DOWNLOAD_BUFF_SZ];
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
Thread.Sleep(5);
|
||||||
var bytesRead = _networkStream.Read(buff, 0, DOWNLOAD_BUFF_SZ);
|
var bytesRead = _networkStream.Read(buff, 0, DOWNLOAD_BUFF_SZ);
|
||||||
_writeFile.Write(buff, 0, bytesRead);
|
_writeFile.Write(buff, 0, bytesRead);
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0-windows</TargetFramework>
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
<Version>7.5.0.1</Version>
|
<Version>7.5.0.8</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -14,6 +14,20 @@ namespace LibationWinForms
|
|||||||
{
|
{
|
||||||
productsGrid.LiberateClicked += (_, lb) => processBookQueue1.AddDownloadDecrypt(lb);
|
productsGrid.LiberateClicked += (_, lb) => processBookQueue1.AddDownloadDecrypt(lb);
|
||||||
processBookQueue1.popoutBtn.Click += ProcessBookQueue1_PopOut;
|
processBookQueue1.popoutBtn.Click += ProcessBookQueue1_PopOut;
|
||||||
|
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
Task.Delay(3000).Wait();
|
||||||
|
var lb = ApplicationServices.DbContexts.GetLibrary_Flat_NoTracking().Select(lb => lb.Book).ToList();
|
||||||
|
|
||||||
|
foreach (var b in lb)
|
||||||
|
{
|
||||||
|
b.UserDefinedItem.BookStatus = DataLayer.LiberatedStatus.NotLiberated;
|
||||||
|
}
|
||||||
|
LibraryCommands.UpdateUserDefinedItem(lb);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int WidthChange = 0;
|
int WidthChange = 0;
|
||||||
|
|||||||
@ -106,21 +106,21 @@ namespace LibationWinForms.ProcessQueue
|
|||||||
return Result = ProcessBookResult.Success;
|
return Result = ProcessBookResult.Success;
|
||||||
else if (statusHandler.Errors.Contains("Cancelled"))
|
else if (statusHandler.Errors.Contains("Cancelled"))
|
||||||
{
|
{
|
||||||
Logger.Info($"Process was cancelled {LibraryBook.Book}");
|
Logger.Info($"{CurrentProcessable.Name}: Process was cancelled {LibraryBook.Book}");
|
||||||
return Result = ProcessBookResult.Cancelled;
|
return Result = ProcessBookResult.Cancelled;
|
||||||
}
|
}
|
||||||
else if (statusHandler.Errors.Contains("Validation failed"))
|
else if (statusHandler.Errors.Contains("Validation failed"))
|
||||||
{
|
{
|
||||||
Logger.Info($"Validation failed {LibraryBook.Book}");
|
Logger.Info($"{CurrentProcessable.Name}: Validation failed {LibraryBook.Book}");
|
||||||
return Result = ProcessBookResult.ValidationFail;
|
return Result = ProcessBookResult.ValidationFail;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var errorMessage in statusHandler.Errors)
|
foreach (var errorMessage in statusHandler.Errors)
|
||||||
Logger.Error(errorMessage);
|
Logger.Error($"{CurrentProcessable.Name}: {errorMessage}");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.Error(ex);
|
Logger.Error(ex, CurrentProcessable.Name);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@ -151,7 +151,7 @@ namespace LibationWinForms.ProcessQueue
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.Error(ex, "Error while cancelling");
|
Logger.Error(ex, $"{CurrentProcessable.Name}: Error while cancelling");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -130,7 +130,7 @@ namespace LibationWinForms
|
|||||||
displayWindow.Show(this);
|
displayWindow.Show(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Liberate_Click(GridEntry liveGridEntry)
|
private async void Liberate_Click(GridEntry liveGridEntry)
|
||||||
{
|
{
|
||||||
var libraryBook = liveGridEntry.LibraryBook;
|
var libraryBook = liveGridEntry.LibraryBook;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user