Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed May 26, 2024
1 parent d31e5fe commit 80942ad
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<DataGridColumnText TItem="QuartzExecutionLogEntity" ElementId="quartz-job" Field="@nameof(QuartzExecutionLogEntity.JobName)" Caption="Job" Filterable Sortable SortField="@nameof(EntityFields.JobName)" />
<DataGridColumnText TItem="QuartzExecutionLogEntity" Field="@nameof(QuartzExecutionLogEntity.TriggerName)" Caption="Trigger" Filterable="@false" Sortable="@false" />
<DataGridColumnDateTime TItem="QuartzExecutionLogEntity" Field="@nameof(QuartzExecutionLogEntity.ScheduleFireTimeUtc)" Caption="Schedule Fire Time" Filterable="@false" Sortable="@false" >
<DisplayTemplate>@(context.ScheduleFireTimeUtc?.ToString("yyyy-MM-dd HH:mm:ss"))</DisplayTemplate>
<DisplayTemplate>@(context.ScheduleFireTimeUtc?.ToString("yyyy-MM-dd HH:mm:ss") ?? string.Empty)</DisplayTemplate>
</DataGridColumnDateTime>
<DataGridColumnDateTime TItem="QuartzExecutionLogEntity" ElementId="quartz-actual-fire-time" Field="@nameof(QuartzExecutionLogEntity.FireTimeUtc)" Caption="Actual Fire Time" Filterable Sortable SortField="@nameof(EntityFields.FireTimeUtc)" >
<DisplayTemplate>@(context.FireTimeUtc.ToString("yyyy-MM-dd HH:mm:ss"))</DisplayTemplate>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using BUTR.Site.NexusMods.Server.Models;
using BUTR.Site.NexusMods.Server.Models.Database;

using Microsoft.EntityFrameworkCore;
Expand All @@ -12,9 +11,8 @@ public CrashReportIgnoredFileIdEntityConfiguration(ITenantContextAccessor tenant

protected override void ConfigureModel(EntityTypeBuilder<CrashReportIgnoredFileEntity> builder)
{
builder.Property(x => x.CrashReportIgnoredFileId).HasColumnName("crash_report_file_ignored_id").ValueGeneratedOnAdd();
builder.Property(x => x.Value).HasColumnName("value").HasVogenConversion();
builder.ToTable("crash_report_file_ignored", "crashreport").HasKey(x => x.CrashReportIgnoredFileId);
builder.Property(x => x.CrashReportFileId).HasColumnName("crash_report_file_ignored_id").ValueGeneratedOnAdd();
builder.ToTable("crash_report_file_ignored", "crashreport").HasKey(x => new { x.TenantId, Value = x.CrashReportFileId });

base.ConfigureModel(builder);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ public sealed record CrashReportIgnoredFileEntity : IEntityWithTenant
{
public required TenantId TenantId { get; init; }

public required int CrashReportIgnoredFileId { get; init; }
public required CrashReportFileId CrashReportFileId { get; init; }

public required CrashReportFileId Value { get; init; }

public override int GetHashCode() => HashCode.Combine(TenantId, CrashReportIgnoredFileId, Value);
public override int GetHashCode() => HashCode.Combine(TenantId, CrashReportFileId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,8 @@ await _linkedCrashReportsChannel.Writer.WriteAsync(new CrashReportToFileIdEntity
await _ignoredCrashReportsChannel.Writer.WaitToWriteAsync(ct);
await _ignoredCrashReportsChannel.Writer.WriteAsync(new CrashReportIgnoredFileEntity
{
CrashReportIgnoredFileId = default,
TenantId = tenant,
Value = duplicateLink.FileId
CrashReportFileId = duplicateLink.FileId
}, ct);
}

Expand Down Expand Up @@ -238,9 +237,8 @@ private async Task<int> WriteCrashReportsToDatabaseAsync(CancellationToken ct)
{
ignoredCrashReportFileEntities.Add(new CrashReportIgnoredFileEntity
{
CrashReportIgnoredFileId = default,
TenantId = tenant,
Value = fileId
CrashReportFileId = fileId
});
continue;
}
Expand Down Expand Up @@ -295,9 +293,8 @@ private async Task<int> WriteCrashReportsToDatabaseAsync(CancellationToken ct)
.Concat(ignoredCrashReportFileEntities.ToAsyncEnumerable())
.Concat(failedCrashReportFileIds.Select(x => new CrashReportIgnoredFileEntity
{
CrashReportIgnoredFileId = default,
TenantId = tenant,
Value = x,
CrashReportFileId = x,
}).ToAsyncEnumerable());

unitOfWrite.CrashReports.UpsertRange(crashReportsBuilder);
Expand Down

0 comments on commit 80942ad

Please sign in to comment.