(ctx context.Context, currentCachedSequence uint64)
| 1205 | } |
| 1206 | |
| 1207 | func (col *DatabaseCollectionWithUser) waitForCacheUpdate(ctx context.Context, currentCachedSequence uint64) (cancelled bool) { |
| 1208 | ticker := time.NewTicker(100 * time.Millisecond) |
| 1209 | defer ticker.Stop() |
| 1210 | for retry := 0; retry <= 50; retry++ { |
| 1211 | select { |
| 1212 | // Check if feed has been terminated regardless of if any changes have happened |
| 1213 | case <-ctx.Done(): |
| 1214 | return true |
| 1215 | case <-ticker.C: |
| 1216 | if col.changeCache().getChannelCache().GetHighCacheSequence() != currentCachedSequence { |
| 1217 | return false |
| 1218 | } |
| 1219 | } |
| 1220 | } |
| 1221 | return false |
| 1222 | } |
| 1223 | |
| 1224 | // Returns the set of cached log entries for a given channel |
| 1225 | func (c *DatabaseCollection) GetChangeLog(ctx context.Context, channel channels.ID, afterSeq uint64) (entries []*LogEntry, err error) { |
no test coverage detected