shell: Fix $wgShellboxUrls by passing service name when creating BoxedCommand
To be able to use non-default Shellbox URLs, we need to be able to pass in a service name when creating the ShellboxClient. Have CommandFactory::createBoxed() take a $service parameter that can be used to change which Shellbox will be hit, as intended. Bug: T290193 Change-Id: Ic1671a69070f962dbb0083028faf34d6d437022a
This commit is contained in:
parent
930841b4c7
commit
b6d1afa1aa
1 changed files with 6 additions and 3 deletions
|
|
@ -172,12 +172,15 @@ class CommandFactory {
|
|||
/**
|
||||
* Instantiates a new BoxedCommand.
|
||||
*
|
||||
* @param ?string $service Name of Shellbox (as configured in
|
||||
* $wgShellboxUrls) that should be used
|
||||
* @return BoxedCommand
|
||||
*/
|
||||
public function createBoxed(): BoxedCommand {
|
||||
if ( $this->shellboxClientFactory->isEnabled() ) {
|
||||
public function createBoxed( ?string $service = null ): BoxedCommand {
|
||||
if ( $this->shellboxClientFactory->isEnabled( $service ) ) {
|
||||
$client = $this->shellboxClientFactory->getClient( [
|
||||
'timeout' => $this->limits['walltime'] + 1
|
||||
'timeout' => $this->limits['walltime'] + 1,
|
||||
'service' => $service,
|
||||
] );
|
||||
$executor = new RemoteBoxedExecutor( $client );
|
||||
$executor->setLogger( $this->logger );
|
||||
|
|
|
|||
Loading…
Reference in a new issue