Skip to content

Commit

Permalink
Reset the backoff and start/stop management service in proper order
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Aug 2, 2024
1 parent d567fe1 commit 0ba2c92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class ManagementService(
error("ManagementService already started")
}

channel.resetConnectBackoff()
job = scope.launch { subscribeEvents() }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ class MullvadVpnService : TalpidVpnService(), ShouldBeOnForegroundProvider {
// TODO We should avoid lifecycleScope.launch (current needed due to InetSocketAddress
// with intent from API)
lifecycleScope.launch(context = Dispatchers.IO) {
managementService.start()

prepareFiles(this@MullvadVpnService)
migrateSplitTunneling.migrate()

Logger.d("Start daemon")
startDaemon()

Logger.d("Start management service")
managementService.start()
}
}

Expand Down Expand Up @@ -206,9 +208,10 @@ class MullvadVpnService : TalpidVpnService(), ShouldBeOnForegroundProvider {

override fun onDestroy() {
Logger.i("MullvadVpnService: onDestroy")
// Shutting down the daemon gracefully
managementService.stop()

// Shutting down the daemon gracefully
Logger.i("Shutdown MullvadDaemon")
MullvadDaemon.shutdown()
super.onDestroy()
}
Expand Down

0 comments on commit 0ba2c92

Please sign in to comment.