chore: increase mailserver request timeout (#2497)
This commit is contained in:
parent
ede86b68ce
commit
6dcc059031
|
@ -20,7 +20,7 @@ import (
|
|||
|
||||
// tolerance is how many seconds of potentially out-of-order messages we want to fetch
|
||||
var tolerance uint32 = 60
|
||||
var mailserverRequestTimeout = 45 * time.Second
|
||||
var mailserverRequestTimeout = 60 * time.Second
|
||||
var oneMonthInSeconds uint32 = 31 * 24 * 60 * 60
|
||||
|
||||
var ErrNoFiltersForChat = errors.New("no filter registered for given chat")
|
||||
|
@ -425,6 +425,7 @@ func (m *Messenger) processMailserverBatch(batch MailserverBatch) error {
|
|||
|
||||
for len(cursor) != 0 || storeCursor != nil {
|
||||
logger.Info("retrieved cursor", zap.String("cursor", types.EncodeHex(cursor)))
|
||||
err = func() error {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), mailserverRequestTimeout)
|
||||
defer cancel()
|
||||
|
||||
|
@ -432,6 +433,11 @@ func (m *Messenger) processMailserverBatch(batch MailserverBatch) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
logger.Info("waiting until message processed")
|
||||
m.waitUntilP2PMessagesProcessed()
|
||||
|
|
Loading…
Reference in New Issue