Skip to content

Commit

Permalink
DDST-280 : CReate a drush command with sudo code for processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashant-bd committed Jul 16, 2024
1 parent 7b6713c commit 280df55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
7 changes: 0 additions & 7 deletions src/Drush/Commands/Generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,6 @@ public function generateBatch(IdentifierInterface $identifier, ?string $ids, &$c
foreach ($query->execute() as $result) {
try {
$sandbox['last_id'] = $result;

// todo: Query against the external server directly (Handle/Ark/whatever) to get what the
// location is set as and compare it to what it should be set as or short circuit the actual
// request to the server and see if the minted identifier being resolved is equal to what we expect.



$entity = $this->entityTypeManager->getStorage($entity_type)->load($result);
$this->ourLogger->debug('Attempting to generate an identifier for {entity} {entity_id}.', [
'entity' => $entity_type,
Expand Down
15 changes: 5 additions & 10 deletions src/Drush/Commands/UpdateIdentifierLocations.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,21 +224,16 @@ public function generateBatch(IdentifierInterface $identifier, ?string $ids, &$c
$sandbox['last_id'] = $result;

$entity = $this->entityTypeManager->getStorage($entity_type)->load($result);
$this->ourLogger->debug('Attempting to generate an identifier for {entity} {entity_id}.', [
$this->ourLogger->debug('Attempting to generate/validate location for {entity} {entity_id}.', [
'entity' => $entity_type,
'entity_id' => $result,
]);
if (!$entity) {
$this->ourLogger->debug(
'Failed to load {entity} {entity_id}; skipping.', [
'entity' => $entity_type,
'entity_id' => $result,
]
);
continue;
// $identifier = $node->get($identifier_field)->getString();
// $response = \Drupal::service('http_client')->request('GET', $identifier);
// Parse the response to get the actual location.
// Does the location from the response = what we expect generated with the new change?
}

$reactions = $this->utils->getActiveReactionsForEntity(EntityMintReaction::class, $entity);
}
catch (\Exception $e) {
$this->ourLogger->error(
Expand Down

0 comments on commit 280df55

Please sign in to comment.