nsqio / go-diskqueue

A Go package providing a filesystem-backed FIFO queue
MIT License
471 stars 101 forks source link

maxBytesPerFile acts like minBytesPerFile #30

Closed kev1n80 closed 3 years ago

kev1n80 commented 3 years ago

Since writeOne() checks if the file size exceeds the limit after writing the data instead of checking if writing the data will cause the file size to exceed the limit before writing, this causes the maximum file size to be maxBytesPerFile + maxMsgSize + 3.

mreiferson commented 3 years ago

Good catch, I suppose we should do this check the other way around and from a quick scan of the code I think everything else should work (particularly after #23)