Skip to content

Commit 39883a9

Browse files
Add minimum batch size for the MemoryConfig.batch_size
To avoid sanity checks downstream, ConfigParser should sanity check the value of the batch size.
1 parent d5fecd5 commit 39883a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dhtnode/main.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public class DhtNodeServer : DaemonApp
171171
/// This is a de facto record size limit, as any records that exceed the
172172
/// configured batch size cannot be returned to clients via batch
173173
/// requests.
174-
size_t batch_size = RecordBatcher.DefaultMaxBatchSize;
174+
ConfigReader.Min!(size_t, 1024, RecordBatcher.DefaultMaxBatchSize) batch_size;
175175

176176
/***********************************************************************
177177
@@ -511,7 +511,7 @@ public class DhtNodeServer : DaemonApp
511511
this.storage_channels = new StorageChannels(this.server_config.data_dir,
512512
this.memory_config.size_limit, this.hash_range,
513513
this.memory_config.bnum, this.memory_config.out_of_range_handling,
514-
this.memory_config.disable_direct_io, this.memory_config.batch_size);
514+
this.memory_config.disable_direct_io, this.memory_config.batch_size());
515515

516516
return this.storage_channels;
517517
}

0 commit comments

Comments
 (0)