Closed SwanSpouse closed 4 years ago
Makes sense, thanks.
(It seems like it would be even more correct to see if the current message will fit under the maxBytesPerFile
before writing it, because even with this change there will usually be some trailing bytes of the last message which go past maxBytesPerFile
in typical usage. But that can be a later improvement IMHO.)
there will usually be some trailing bytes of the last message which go past maxBytesPerFile in typical usage
About this question, if we want current message fits under themaxBytesPerFile
, we should make sure that maxMsgSize
is smaller than maxBytesPerFile
in dq's constructor.
when d.writePos == maxBytesPerFile, "writeOne" func continues to write a message to current file, this will make current file one message larger than expected.