diff options
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt b/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt index 491feaf0..5649e8de 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt +++ b/app/src/main/java/com/zeapo/pwdstore/git/operation/GitOperation.kt @@ -108,6 +108,7 @@ abstract class GitOperation(protected val callingActivity: FragmentActivity) { (transport as? SshTransport)?.sshSessionFactory = sshSessionFactory credentialsProvider?.let { transport.credentialsProvider = it } } + command.setTimeout(CONNECT_TIMEOUT) } } @@ -204,4 +205,12 @@ abstract class GitOperation(protected val callingActivity: FragmentActivity) { sshSessionFactory?.close() } } + + companion object { + + /** + * Timeout in seconds before [TransportCommand] will abort a stalled IO operation. + */ + private const val CONNECT_TIMEOUT = 10 + } } |