Commit 8642cfe Diego Diverio
committed
1 parent 17157e0 commit 8642cfe Copy full SHA for 8642cfe
File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,12 @@ runCommandLoop core = go
171
171
postUpdate :: Path -> Core -> IO ()
172
172
postUpdate path core = atomically $ do
173
173
value <- Persistence. getValue (coreCurrentValue core)
174
- writeTBQueue (coreUpdates core) (Just $ Updated path value)
174
+ full <- isFullTBQueue (coreUpdates core)
175
+ -- In order not to block the reader thread, and subsequently stop processing coreQueue,
176
+ -- we don't send new updates to subscribers if coreUpdates is full.
177
+ if full then
178
+ return ()
179
+ else writeTBQueue (coreUpdates core) (Just $ Updated path value)
175
180
176
181
-- | Periodically send a 'Sync' command to the 'Core' if enabled in the core
177
182
-- configuration.
You can’t perform that action at this time.
0 commit comments