Skip to content

Commit 59c3a1c

Browse files
committed
Adjust cache queue removal to still remove the item from the queue even if its information cannot be resolved successfully.
1 parent 67eb570 commit 59c3a1c

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

xivModdingFramework/Cache/XivCache.cs

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,12 +2191,18 @@ private static void ProcessDependencyQueue(object sender, DoWorkEventArgs e)
21912191
level = XivDependencyGraph.GetDependencyLevel(file);
21922192
if (level == XivDependencyLevel.Invalid) continue;
21932193

2194-
// The get call will automatically cache the data, if it needs updating.
2195-
var task = GetChildFiles(file, false);
2194+
try
2195+
{
2196+
// The get call will automatically cache the data, if it needs updating.
2197+
var task = GetChildFiles(file, false);
21962198

2197-
// Set a safety timeout here.
2198-
task.Wait(3000);
2199-
RemoveFromChildQueue(file);
2199+
// Set a safety timeout here.
2200+
task.Wait(3000);
2201+
}
2202+
finally
2203+
{
2204+
RemoveFromChildQueue(file);
2205+
}
22002206
continue;
22012207

22022208
}
@@ -2217,12 +2223,17 @@ private static void ProcessDependencyQueue(object sender, DoWorkEventArgs e)
22172223
level = XivDependencyGraph.GetDependencyLevel(file);
22182224
if (level == XivDependencyLevel.Invalid) continue;
22192225

2220-
// The get call will automatically cache the data, if it needs updating.
2221-
var task = GetParentFiles(file, false);
2226+
try
2227+
{
2228+
// The get call will automatically cache the data, if it needs updating.
2229+
var task = GetParentFiles(file, false);
22222230

2223-
// Set a safety timeout here.
2224-
task.Wait(3000);
2225-
RemoveFromParentQueue(file);
2231+
// Set a safety timeout here.
2232+
task.Wait(3000);
2233+
} finally
2234+
{
2235+
RemoveFromParentQueue(file);
2236+
}
22262237
continue;
22272238
}
22282239
}

xivModdingFramework/SqPack/FileTypes/Index.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1883,7 +1883,7 @@ await Task.Run(() =>
18831883

18841884
if (oldOffset == 0)
18851885
{
1886-
throw new Exception("Cannot update index information for file with null data offset.");
1886+
throw new Exception("Cannot update index information for file with invalid data offset.");
18871887
}
18881888

18891889
bw.BaseStream.Seek(br.BaseStream.Position - 4, SeekOrigin.Begin);

0 commit comments

Comments
 (0)