Skip to content

Commit

Permalink
skip emitting * channel twice
Browse files Browse the repository at this point in the history
  • Loading branch information
nirav24 committed Dec 27, 2022
1 parent ed9d48f commit b773173
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions db/design_doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,17 +482,21 @@ func installViews(ctx context.Context, viewStore sgbucket.ViewStore) error {
if (channels) {
for (var name in channels) {
removed = channels[name];
if (!removed)
// if EnableStarChannelLog= true and "*" is added because AllDocs index isn't created
// Skip emiting "*" again as above lines has emitted "*" channel
if (name == "*" && %v) // EnableStarChannelLog
continue
if (!removed) {
emit([name, sequence], value);
else {
} else {
var flags = removed.del ? %d : %d; // channels.Removed/Deleted
emit([name, removed.seq], {rev:removed.rev, flags: flags});
}
}
}
}`

channels_map = fmt.Sprintf(channels_map, syncData, base.SyncDocPrefix, ch.Deleted, EnableStarChannelLog,
channels_map = fmt.Sprintf(channels_map, syncData, base.SyncDocPrefix, ch.Deleted, EnableStarChannelLog, EnableStarChannelLog,
ch.Removed|ch.Deleted, ch.Removed)

// Channel access view, used by ComputeChannelsForPrincipal()
Expand Down

0 comments on commit b773173

Please sign in to comment.