@@ -280,34 +280,34 @@ func (store *fileStore) NextTargetMsgSeqNum() int {
280280
281281// SetNextSenderMsgSeqNum sets the next MsgSeqNum that will be sent.
282282func (store * fileStore ) SetNextSenderMsgSeqNum (next int ) error {
283- if err := store .cache . SetNextSenderMsgSeqNum ( next ); err != nil {
284- return errors .Wrap (err , "cache " )
283+ if err := store .setSeqNum ( store . senderSeqNumsFile , next ); err != nil {
284+ return errors .Wrap (err , "file " )
285285 }
286- return store .setSeqNum ( store . senderSeqNumsFile , next )
286+ return store .cache . SetNextSenderMsgSeqNum ( next )
287287}
288288
289289// SetNextTargetMsgSeqNum sets the next MsgSeqNum that should be received.
290290func (store * fileStore ) SetNextTargetMsgSeqNum (next int ) error {
291- if err := store .cache . SetNextTargetMsgSeqNum ( next ); err != nil {
292- return errors .Wrap (err , "cache " )
291+ if err := store .setSeqNum ( store . targetSeqNumsFile , next ); err != nil {
292+ return errors .Wrap (err , "file " )
293293 }
294- return store .setSeqNum ( store . targetSeqNumsFile , next )
294+ return store .cache . SetNextTargetMsgSeqNum ( next )
295295}
296296
297297// IncrNextSenderMsgSeqNum increments the next MsgSeqNum that will be sent.
298298func (store * fileStore ) IncrNextSenderMsgSeqNum () error {
299- if err := store .cache .IncrNextSenderMsgSeqNum ( ); err != nil {
300- return errors .Wrap (err , "cache " )
299+ if err := store .SetNextSenderMsgSeqNum ( store . cache .NextSenderMsgSeqNum () + 1 ); err != nil {
300+ return errors .Wrap (err , "file " )
301301 }
302- return store . setSeqNum ( store . senderSeqNumsFile , store . cache . NextSenderMsgSeqNum ())
302+ return nil
303303}
304304
305305// IncrNextTargetMsgSeqNum increments the next MsgSeqNum that should be received.
306306func (store * fileStore ) IncrNextTargetMsgSeqNum () error {
307- if err := store .cache .IncrNextTargetMsgSeqNum ( ); err != nil {
308- return errors .Wrap (err , "cache " )
307+ if err := store .SetNextTargetMsgSeqNum ( store . cache .NextTargetMsgSeqNum () + 1 ); err != nil {
308+ return errors .Wrap (err , "file " )
309309 }
310- return store . setSeqNum ( store . targetSeqNumsFile , store . cache . NextTargetMsgSeqNum ())
310+ return nil
311311}
312312
313313// CreationTime returns the creation time of the store.
0 commit comments