mirror of https://github.com/Radarr/Radarr
Added uguid to exceptioninstance
This commit is contained in:
parent
245e122c61
commit
969c36912d
|
@ -33,6 +33,7 @@ namespace NzbDrone.Services.Service.Controllers
|
|||
ExceptionHash = existingExceptionReport.Hash,
|
||||
IsProduction = existingExceptionReport.IsProduction,
|
||||
LogMessage = existingExceptionReport.LogMessage,
|
||||
UGuid = existingExceptionReport.UGuid,
|
||||
Timestamp = DateTime.Now
|
||||
};
|
||||
|
||||
|
@ -64,7 +65,8 @@ namespace NzbDrone.Services.Service.Controllers
|
|||
ExceptionHash = exceptionHash,
|
||||
IsProduction = exceptionReport.IsProduction,
|
||||
LogMessage = exceptionReport.LogMessage,
|
||||
Timestamp = DateTime.Now
|
||||
Timestamp = DateTime.Now,
|
||||
UGuid = exceptionReport.UGuid
|
||||
};
|
||||
|
||||
_database.Insert(exceptionInstance);
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace NzbDrone.Services.Service.Migrations
|
|||
new Column("ExceptionHash", DbType.String, ColumnProperty.NotNull),
|
||||
new Column("LogMessage", DbType.String, 3000, ColumnProperty.NotNull),
|
||||
MigrationsHelper.TimestampColumn,
|
||||
MigrationsHelper.UGuidColumn,
|
||||
MigrationsHelper.ProductionColumn);
|
||||
|
||||
Database.AddTable("Exceptions", new Column("Hash", DbType.String, ColumnProperty.Unique),
|
||||
|
|
|
@ -12,5 +12,6 @@ namespace NzbDrone.Services.Service.Repository.Reporting
|
|||
public string LogMessage { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
public bool IsProduction { get; set; }
|
||||
public Guid UGuid { get; set; }
|
||||
}
|
||||
}
|
|
@ -54,12 +54,20 @@ namespace NzbDrone.Services.Tests.ExceptionControllerTests
|
|||
|
||||
var existing = CreateExceptionReport();
|
||||
|
||||
|
||||
Db.Insert(Builder<ExceptionDetail>.CreateNew().With(c => c.Hash = existing.Hash).Build());
|
||||
|
||||
Controller.ReportExisting(CreateExceptionReport());
|
||||
Controller.ReportExisting(existing);
|
||||
|
||||
Db.Fetch<ExceptionDetail>().Should().HaveCount(1);
|
||||
Db.Fetch<ExceptionInstance>().Should().HaveCount(1);
|
||||
var exceptionInstance = Db.Fetch<ExceptionInstance>();
|
||||
exceptionInstance.Should().HaveCount(1);
|
||||
exceptionInstance.Single().Id.Should().BeGreaterThan(0);
|
||||
exceptionInstance.Single().ExceptionHash.Should().NotBeBlank();
|
||||
exceptionInstance.Single().IsProduction.Should().Be(existing.IsProduction);
|
||||
exceptionInstance.Single().Timestamp.Should().BeWithin(TimeSpan.FromSeconds(4)).Before(DateTime.Now);
|
||||
exceptionInstance.Single().LogMessage.Should().Be(existing.LogMessage);
|
||||
exceptionInstance.Single().UGuid.Should().Be(existing.UGuid);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ namespace NzbDrone.Services.Tests.ExceptionControllerTests
|
|||
exceptionInstance.Single().IsProduction.Should().Be(exceptionReport.IsProduction);
|
||||
exceptionInstance.Single().Timestamp.Should().BeWithin(TimeSpan.FromSeconds(4)).Before(DateTime.Now);
|
||||
exceptionInstance.Single().LogMessage.Should().Be(exceptionReport.LogMessage);
|
||||
exceptionInstance.Single().UGuid.Should().Be(exceptionReport.UGuid);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
Loading…
Reference in New Issue