Skip to content
This repository was archived by the owner on Dec 18, 2022. It is now read-only.

Commit 260d3af

Browse files
committed
add new option to ServiceTorSettings class implementation
1 parent 51378a5 commit 260d3af

File tree

1 file changed

+10
-0
lines changed
  • topl-service/src/main/java/io/matthewnelson/topl_service/service/components/onionproxy

1 file changed

+10
-0
lines changed

topl-service/src/main/java/io/matthewnelson/topl_service/service/components/onionproxy/ServiceTorSettings.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ class ServiceTorSettings internal constructor(
9898
val defaultTorSettings: TorSettings
9999
): TorSettings() {
100100

101+
override val dormantClientTimeout: Int?
102+
get() = servicePrefs.getInt(PrefKeyInt.DORMANT_CLIENT_TIMEOUT, defaultTorSettings.dormantClientTimeout)
103+
104+
fun dormantClientTimeoutSave(minutes: Int?) {
105+
if (minutes == defaultTorSettings.dormantClientTimeout)
106+
servicePrefs.remove(PrefKeyInt.DORMANT_CLIENT_TIMEOUT)
107+
else
108+
servicePrefs.putInt(PrefKeyInt.DORMANT_CLIENT_TIMEOUT, minutes)
109+
}
110+
101111
override val disableNetwork: Boolean
102112
get() = servicePrefs.getBoolean(PrefKeyBoolean.DISABLE_NETWORK, defaultTorSettings.disableNetwork)
103113

0 commit comments

Comments
 (0)