Skip to content

Commit

Permalink
Revert database condition on business.stop
Browse files Browse the repository at this point in the history
  • Loading branch information
dpad85 committed Feb 22, 2024
1 parent 8872596 commit cfc3e45
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class ChannelsWatcher(context: Context, workerParams: WorkerParameters) : Corout
return Result.failure()
} finally {
business.appConnectionsDaemon?.incrementDisconnectCount(AppConnectionsDaemon.ControlTarget.All)
business.stop(includingDatabase = false)
business.stop()
log.info("stopped channels-watcher business")
}
}
Expand Down
2 changes: 1 addition & 1 deletion phoenix-ios/phoenix-ios/officers/BusinessManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class BusinessManager {
public func stop() {

cancellables.removeAll()
business.stop(includingDatabase: true)
business.stop()
syncManager?.shutdown()
}

Expand Down
4 changes: 2 additions & 2 deletions phoenix-ios/phoenix-notifySrvExt/PhoenixManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class PhoenixManager {
}

if let prvBusiness = oldBusiness {
prvBusiness.stop(includingDatabase: true)
prvBusiness.stop()
oldBusiness = nil
oldCancellables.removeAll()
}
Expand Down Expand Up @@ -317,7 +317,7 @@ class PhoenixManager {
connections.electrum is Lightning_kmpConnection.CLOSED
{
if let prvBusiness = oldBusiness {
prvBusiness.stop(includingDatabase: true)
prvBusiness.stop()
oldBusiness = nil
oldCancellables.removeAll()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,16 @@ class PhoenixBusiness(
* It's recommended that you close the network connections (electrum + peer)
* BEFORE invoking this function, to ensure a clean disconnect from the server.
*/
fun stop(includingDatabase: Boolean = true) {
fun stop() {
electrumClient.stop()
electrumWatcher.stop()
electrumWatcher.cancel()
appConnectionsDaemon?.cancel()
if (includingDatabase) {
appDb.close()
}
appDb.close()
networkMonitor.stop()
walletManager.cancel()
nodeParamsManager.cancel()
if (includingDatabase) {
databaseManager.close()
}
databaseManager.close()
databaseManager.cancel()
databaseManager.cancel()
peerManager.cancel()
Expand Down

0 comments on commit cfc3e45

Please sign in to comment.