~edwargix/tallyard

1e94d71261e42e96a63a3b828901ddbd1965f522 — David Florness 2 years ago b47f8d8
Log sync errors

and decrease the sleep duration from 10 seconds [0] to 5 seconds.

[0]: https://github.com/mautrix/go/blob/v0.10.8/sync.go#L228
1 files changed, 18 insertions(+), 0 deletions(-)

A cmd/tallyard/syncer.go
A cmd/tallyard/syncer.go => cmd/tallyard/syncer.go +18 -0
@@ 0,0 1,18 @@
package main

import (
	"time"

	log "github.com/sirupsen/logrus"
	"maunium.net/go/mautrix"
)

type TallyardSyncer struct {
	*mautrix.DefaultSyncer
}

func (s *TallyardSyncer) OnFailedSync(res *mautrix.RespSync, err error) (time.Duration, error) {
	sleepDuration := 5 * time.Second
	log.Warnf("encountered sync error; retrying in %s: %s", sleepDuration, err)
	return sleepDuration, nil
}