this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

backpressure on pending ids channel

dholms dcec76dc 126f1ebe

+6 -6
+6 -6
cmd/nexus/outbox.go
··· 140 140 outboxEvt.ID = dbEvt.ID 141 141 o.eventCache[dbEvt.ID] = &outboxEvt 142 142 143 - select { 144 - case o.pendingIDs <- dbEvt.ID: 145 - default: 146 - // Channel full, will try again next time 147 - } 148 - 149 143 if dbEvt.ID > o.lastLoadedID { 150 144 o.lastLoadedID = dbEvt.ID 151 145 } 152 146 } 153 147 o.cacheMu.Unlock() 148 + 149 + // do outside of cacheMu lock to avoid holding the lcok in the case of back pressure 150 + for _, dbEvt := range events { 151 + // back pressure if pendingIDs channel is full 152 + o.pendingIDs <- dbEvt.ID 153 + } 154 154 } 155 155 156 156 // runDelivery continuously pulls from pendingIDs and delivers events