| 224 | } |
| 225 | |
| 226 | func (s *Service) saveSubscriptionStatus(dbID proto.DatabaseID, count int32) (err error) { |
| 227 | log.WithFields(log.Fields{}).Debug("save subscription status") |
| 228 | |
| 229 | if atomic.LoadInt32(&s.stopped) == 1 { |
| 230 | // stopped |
| 231 | return ErrStopped |
| 232 | } |
| 233 | |
| 234 | _, err = s.db.Writer().Exec(saveSubscriptionSQL, string(dbID), count) |
| 235 | if err != nil { |
| 236 | err = errors.Wrapf(err, "save subscription failed: %s, %d", dbID, count) |
| 237 | } |
| 238 | return |
| 239 | } |
| 240 | |
| 241 | func (s *Service) addAck(dbID proto.DatabaseID, height int32, offset int32, ack *types.SignedAckHeader) (err error) { |
| 242 | log.WithFields(log.Fields{ |