Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Robust.Cdn/Jobs/IngestNewCdnContentJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public async Task Execute(IJobExecutionContext context)
finally
{
transaction.Dispose();
logger.LogInformation("Ingestion for fork \"{Fork}\" finished", fork);
}

await QueueManifestAvailable(fork, newVersions);
Expand Down Expand Up @@ -111,6 +112,10 @@ private void IngestNewVersions(
try
{
var versionIdx = 0;

if (newVersions.Count < 1)
logger.LogWarning("No versions provided to ingest");

foreach (var version in newVersions)
{
if (versionIdx % 5 == 0)
Expand Down Expand Up @@ -335,7 +340,8 @@ private void IngestNewVersions(

private List<string> FindNewVersions(string fork, SqliteConnection con)
{
using var stmtCheckVersion = con.Handle!.Prepare("SELECT 1 FROM ContentVersion WHERE Version = ?");
var forkId = EnsureForkCreated(fork, con);
using var stmtCheckVersion = con.Handle!.Prepare("SELECT 1 FROM ContentVersion WHERE Version = ? AND ForkId = ?");

var newVersions = new List<(string, DateTime)>();

Expand All @@ -353,6 +359,7 @@ private List<string> FindNewVersions(string fork, SqliteConnection con)

stmtCheckVersion.Reset();
stmtCheckVersion.BindString(1, version);
stmtCheckVersion.BindInt(2, forkId);

if (stmtCheckVersion.Step() == raw.SQLITE_ROW)
{
Expand Down