wip(processing): analysis and render job handlers, render node client (interrupted)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
30 files changed
+2262
-21
No files matched your search
@@ -189,16 +189,23 @@ public sealed class LeaseFile : IDisposable
|
||||
|
||||
private static bool TryCreate(string path, LeaseRecord record)
|
||||
{
|
||||
try
|
||||
for (var attempt = 1; ; attempt++)
|
||||
{
|
||||
using var fs = new FileStream(path, FileMode.CreateNew, FileAccess.Write, FileShare.Read);
|
||||
fs.Write(JsonSerializer.SerializeToUtf8Bytes(record, ArchiveJson.Default.LeaseRecord));
|
||||
fs.Flush(flushToDisk: true);
|
||||
return true;
|
||||
}
|
||||
catch (IOException) when (File.Exists(path))
|
||||
{
|
||||
return false;
|
||||
try
|
||||
{
|
||||
using var fs = new FileStream(path, FileMode.CreateNew, FileAccess.Write, FileShare.Read);
|
||||
fs.Write(JsonSerializer.SerializeToUtf8Bytes(record, ArchiveJson.Default.LeaseRecord));
|
||||
fs.Flush(flushToDisk: true);
|
||||
return true;
|
||||
}
|
||||
catch (IOException) when (File.Exists(path))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
catch (IOException) when (attempt < 3)
|
||||
{
|
||||
// The holder released the lease between the failed create and the check: the name is free again.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user