Process unused sequence notification. Extracts sequence from docID and sends to cache for buffering
(ctx context.Context, docID string)
| 693 | |
| 694 | // Process unused sequence notification. Extracts sequence from docID and sends to cache for buffering |
| 695 | func (c *changeCache) processUnusedSequenceRange(ctx context.Context, docID string) { |
| 696 | // _sync:unusedSequences:fromSeq:toSeq |
| 697 | sequencesStr := strings.TrimPrefix(docID, c.metaKeys.UnusedSeqRangePrefix()) |
| 698 | sequences := strings.Split(sequencesStr, ":") |
| 699 | if len(sequences) != 2 { |
| 700 | return |
| 701 | } |
| 702 | |
| 703 | fromSequence, err := strconv.ParseUint(sequences[0], 10, 64) |
| 704 | if err != nil { |
| 705 | base.WarnfCtx(ctx, "Unable to identify from sequence number for unused sequences notification with key: %s, error: %s", base.UD(docID), err) |
| 706 | return |
| 707 | } |
| 708 | toSequence, err := strconv.ParseUint(sequences[1], 10, 64) |
| 709 | if err != nil { |
| 710 | base.WarnfCtx(ctx, "Unable to identify to sequence number for unused sequence notification with key: %s, error: %s", base.UD(docID), err) |
| 711 | return |
| 712 | } |
| 713 | |
| 714 | c.releaseUnusedSequenceRange(ctx, fromSequence, toSequence, channels.NewFeedTimestampFromNow()) |
| 715 | } |
| 716 | |
| 717 | func (c *changeCache) processPrincipalDoc(ctx context.Context, docID string, docJSON []byte, isUser bool, timeReceived channels.FeedTimestamp) { |
| 718 |
no test coverage detected