fix(node): 允许零输入软件任务接单

This commit is contained in:
caoqianming 2026-08-21 10:11:43 +08:00
parent 30180d3816
commit 2a7c6a0fb2
2 changed files with 3 additions and 1 deletions

View File

@ -371,6 +371,8 @@ class WindowsNodeSourceTests(unittest.TestCase):
self.assertNotIn("IsValidOriginRequest", inbox)
self.assertNotIn("IsValidPlot", inbox)
self.assertIn('root.TryGetProperty("input_transfers"', inbox)
self.assertIn("transfers.GetArrayLength() > 16", inbox)
self.assertNotIn("transfers.GetArrayLength() is < 1 or > 16", inbox)
self.assertIn('"input", key, filename', inbox)
self.assertIn("FileOptions.WriteThrough", inbox)
self.assertIn("stream.Flush(flushToDisk: true)", inbox)

View File

@ -457,7 +457,7 @@ internal sealed class JobInboxStore(string jobsDirectory)
private static bool IsValidInputTransfers(JsonElement transfers, Guid jobId)
{
if (transfers.ValueKind != JsonValueKind.Array
|| transfers.GetArrayLength() is < 1 or > 16)
|| transfers.GetArrayLength() > 16)
{
return false;
}