Skip to content

Commit aa82774

Browse files
committed
fix: Another update, to see if we can get this shit to work.
1 parent c795bc6 commit aa82774

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

CFLookup/Jobs/GetLatestUpdatedModPerGame.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public async static Task RunAsync(PerformContext context)
4646
{
4747
allGames.Add(game.Data);
4848
}
49+
50+
if (game != null && game.Error != null && game.Error.ErrorCode != 404)
51+
{
52+
Console.WriteLine($"Error fetching game info for {privateGame.Id}: {game.Error.ErrorMessage}");
53+
continue;
54+
}
4955
await Task.Delay(100);
5056
}
5157
}
@@ -58,7 +64,14 @@ public async static Task RunAsync(PerformContext context)
5864
await Task.Delay(100);
5965

6066
var latestUpdatedMod = await cfClient.SearchModsAsync(game.Id, sortField: ModsSearchSortField.LastUpdated, sortOrder: ModsSearchSortOrder.Descending, pageSize: 1);
61-
if (latestUpdatedMod != null && latestUpdatedMod.Pagination.ResultCount > 0)
67+
68+
if (latestUpdatedMod != null && latestUpdatedMod.Error != null)
69+
{
70+
Console.WriteLine($"Error fetching latest updated mod for {game.Name} (GameId: {game.Id}): {latestUpdatedMod.Error.ErrorMessage}");
71+
continue;
72+
}
73+
74+
if (latestUpdatedMod != null && latestUpdatedMod.Pagination != null && latestUpdatedMod.Pagination.ResultCount > 0)
6275
{
6376
await db.ExecuteNonQueryAsync("UPDATE ProcessingGames SET LastUpdate = GETUTCDATE(), ModCount = @modCount WHERE GameId = @gameId",
6477
new SqlParameter("@modCount", latestUpdatedMod.Pagination.ResultCount),

0 commit comments

Comments
 (0)