Add suspend and resume to managed files

This commit is contained in:
Maurice Parker 2019-12-01 17:16:52 -06:00
parent d9f2e13732
commit 7a8155f58f
5 changed files with 34 additions and 1 deletions

View File

@ -410,11 +410,20 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
delegate.suspend()
database.suspend()
save()
metadataFile.suspend()
webFeedMetadataFile.suspend()
opmlFile.suspend()
}
public func resume() {
database.resume()
delegate.resume()
metadataFile.resume()
webFeedMetadataFile.resume()
opmlFile.resume()
metadataFile.load()
webFeedMetadataFile.load()
opmlFile.load()
}
public func save() {

View File

@ -35,6 +35,14 @@ final class AccountMetadataFile {
managedFile.saveIfNecessary()
}
func suspend() {
managedFile.suspend()
}
func resume() {
managedFile.resume()
}
}
private extension AccountMetadataFile {

View File

@ -36,6 +36,14 @@ final class OPMLFile {
managedFile.saveIfNecessary()
}
func suspend() {
managedFile.suspend()
}
func resume() {
managedFile.resume()
}
}
private extension OPMLFile {

View File

@ -35,6 +35,14 @@ final class WebFeedMetadataFile {
managedFile.saveIfNecessary()
}
func suspend() {
managedFile.suspend()
}
func resume() {
managedFile.resume()
}
}
private extension WebFeedMetadataFile {

@ -1 +1 @@
Subproject commit 4a909600c568b1773785bd9e18075da92d916c69
Subproject commit ee0e60d1ab27bb57a6893d19dbff7783d7a485e6