Skip to content

Commit

Permalink
Attempt Drush call reload directly instead of through SchemaPoster
Browse files Browse the repository at this point in the history
  • Loading branch information
pwtyler committed Nov 13, 2024
1 parent abbb048 commit b1e21d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion drush.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
tags:
- { name: drush.command }
search_api_pantheon.drush_reload:
class: \Drupal\search_api_pantheon\Commands\Reload
class: \Drupal\search_api_pantheon\Commands\SchemaReload
arguments: [ "@logger.factory", "@search_api_pantheon.pantheon_guzzle", "@search_api_pantheon.schema_poster" ]
tags:
- { name: drush.command }
16 changes: 8 additions & 8 deletions src/Commands/Reload.php → src/Commands/SchemaReload.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Logger\LoggerChannelTrait;
use Drupal\search_api_pantheon\Services\PantheonGuzzle;
use Drupal\search_api_pantheon\Services\SchemaPoster;
use Drupal\search_api_pantheon\Services\Reload;
use Drush\Commands\DrushCommands;

/**
* Drush Search Api Pantheon Schema Commands.
*/
class Reload extends DrushCommands {
class SchemaReload extends DrushCommands {
use LoggerChannelTrait;

/**
Expand All @@ -24,9 +24,9 @@ class Reload extends DrushCommands {
/**
* Configured pantheon-solr-specific schema poster class.
*
* @var \Drupal\search_api_pantheon\Services\SchemaPoster
* @var \Drupal\search_api_pantheon\Services\Reload
*/
private SchemaPoster $schemaPoster;
private Reload $reload;

/**
* Class constructor.
Expand All @@ -35,17 +35,17 @@ class Reload extends DrushCommands {
* Injected by container.
* @param \Drupal\search_api_pantheon\Services\PantheonGuzzle $pantheonGuzzle
* Injected by container.
* @param \Drupal\search_api_pantheon\Services\SchemaPoster $schemaPoster
* @param \Drupal\search_api_pantheon\Services\Reload $reload
* Injected by Container.
*/
public function __construct(
LoggerChannelFactoryInterface $loggerChannelFactory,
PantheonGuzzle $pantheonGuzzle,
SchemaPoster $schemaPoster
Reload $reload
) {
$this->logger = $loggerChannelFactory->get('SearchAPIPantheon Drush');
$this->pantheonGuzzle = $pantheonGuzzle;
$this->schemaPoster = $schemaPoster;
$this->reload = $reload;
}

/**
Expand All @@ -58,7 +58,7 @@ public function __construct(
*/
public function reloadSchema() {
try {
$this->schemaPoster->reloadServer();
$this->reload->reloadServer();
}
catch (\Exception $e) {
$this->logger->error((string) $e);
Expand Down

0 comments on commit b1e21d8

Please sign in to comment.