improve live update starting

In an expression like "balanced=foo and exclude=bar", avoid it starting
a live update when the overall expression doesn't match.
This commit is contained in:
Joey Hess 2024-08-24 13:07:05 -04:00
parent 16f945459c
commit d60a33fd13
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 67 additions and 47 deletions

View file

@ -31,7 +31,13 @@ newtype MaxSize = MaxSize { fromMaxSize :: Integer }
-- the changes to its size into account. If NoLiveUpdate is used, it
-- prevents that.
data LiveUpdate
= LiveUpdate (MVar ()) (MVar (UUID, Key, SizeChange)) (MVar ())
= LiveUpdate
{ liveUpdateNeeded :: MVar ()
, liveUpdateStart :: MVar ()
, liveUpdateReady :: MVar ()
, liveUpdateDone :: MVar (Maybe (UUID, Key, SizeChange))
, liveUpdateFinish :: MVar ()
}
| NoLiveUpdate
data SizeChange = AddingKey | RemovingKey