number of sent messages is just i silly

This commit is contained in:
reesporte 2021-10-21 14:24:27 -05:00
parent adf3e528f5
commit 27515a3f98

View file

@ -722,9 +722,8 @@ func (s *Server) Open() error {
if now := time.Now(); now.Sub(prevMsg) > time.Second {
progressRatio := float64(i+1) / float64(len(toSend))
numSentMessages := len(toSend) - (i + 1)
messagesLeft := len(toSend) - numSentMessages
avgTimePerMessage := float64(now.Sub(start)) / float64(numSentMessages)
messagesLeft := len(toSend) - i
avgTimePerMessage := float64(now.Sub(start)) / float64(i)
timeRemaining := time.Duration(avgTimePerMessage * float64(messagesLeft))
s.logger.Printf("synced %d/%d messages (%.2f%% complete; %s remaining)", i+1, len(toSend), 100*progressRatio, timeRemaining)
prevMsg = now