Skip to content

Commit

Permalink
Merge pull request #159 from aik099/svn-command-idle-timeout
Browse files Browse the repository at this point in the history
Reduce the SVN command idle timeout
  • Loading branch information
aik099 authored Oct 19, 2024
2 parents 07d6690 + 9b46f5f commit be2d596
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Changed
- The `config` command groups configuration settings by a command.
- The `changelog` command will show actually used app version instead of `Unreleased` word, when used version isn't mentioned in a changelog.
- The executed SVN command idle timeout changed from 20 minutes to 3 minutes.

### Fixed
- The non-merged revision table was shown after a successful auto-commit, when merge conflict was resolved.
Expand Down
2 changes: 1 addition & 1 deletion src/SVNBuddy/Repository/Connector/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private function _getCacheKey()
*/
private function _doRun($callback = null)
{
$process = $this->_processFactory->createProcess($this->_commandLine, 1200);
$process = $this->_processFactory->createProcess($this->_commandLine, 180); // Idle timeout: 3 minutes.
$command_string = (string)$this;

try {
Expand Down
6 changes: 3 additions & 3 deletions tests/SVNBuddy/Repository/Connector/CommandFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ protected function setupTest()

// To get nice exception back when unexpected command is executed.
$this->_processFactory
->createProcess(Argument::any(), 1200)
->createProcess(Argument::any(), 180)
->will(function (array $args) {
throw new \LogicException('The createProcess("' . implode(' ', $args[0]) . '", 1200) call wasn\'t expected.');
throw new \LogicException('The createProcess("' . implode(' ', $args[0]) . '", 180) call wasn\'t expected.');
});

$this->_commandFactory = $this->_createCommandFactory('', '');
Expand Down Expand Up @@ -176,7 +176,7 @@ private function _expectCommand(array $command, $output, $error_msg = null, $err
$this->_io->isVerbose()->willReturn(false);
$this->_io->isDebug()->willReturn(false);

$this->_processFactory->createProcess($command, 1200)->willReturn($process)->shouldBeCalled();
$this->_processFactory->createProcess($command, 180)->willReturn($process)->shouldBeCalled();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/SVNBuddy/Repository/Connector/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ public static function cacheKeyFormingDataProvider()
private function _createCommand(array $command_line, $use_process = true)
{
if ( $use_process ) {
$this->_processFactory->createProcess($command_line, 1200)->willReturn($this->_process)->shouldBeCalled();
$this->_processFactory->createProcess($command_line, 180)->willReturn($this->_process)->shouldBeCalled();
}

return new Command(
Expand Down

0 comments on commit be2d596

Please sign in to comment.