mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
Pause event loop while FETCHing to prevetn EXPUNGE
This commit is contained in:
@ -348,6 +348,18 @@ func (store *Store) addAddress(address, addressID string, labels []*pmapi.Label)
|
||||
return
|
||||
}
|
||||
|
||||
// PauseEventLoop sets whether the ticker is periodically polling or not.
|
||||
func (store *Store) PauseEventLoop(pause bool) {
|
||||
store.lock.Lock()
|
||||
defer store.lock.Unlock()
|
||||
|
||||
store.log.WithField("pause", pause).Info("Pausing event loop")
|
||||
|
||||
if store.eventLoop != nil {
|
||||
store.eventLoop.isTickerPaused = pause
|
||||
}
|
||||
}
|
||||
|
||||
// Close stops the event loop and closes the database to free the file.
|
||||
func (store *Store) Close() error {
|
||||
store.lock.Lock()
|
||||
|
||||
Reference in New Issue
Block a user