Skip to content

Commit

Permalink
First pass on the Action ADO queworker & and CSV to action
Browse files Browse the repository at this point in the history
So far only acts on delete. But will do magic. I promise @alliomeria
  • Loading branch information
DiegoPino committed Dec 9, 2024
1 parent 37207b5 commit d432e70
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Plugin/QueueWorker/ActionADOQueueWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,11 @@ public static function create(
/**
* {@inheritdoc}
*/
public function processItem($data)
{
public function processItem($data) {
$log = new Logger('ami_file');
$private_path = \Drupal::service('stream_wrapper_manager')->getViaUri('private://')->getDirectoryPath();
$private_path = \Drupal::service('stream_wrapper_manager')
->getViaUri('private://')
->getDirectoryPath();
$handler = new StreamHandler($private_path . '/ami/logs/set' . $data->info['set_id'] . '.log', Logger::DEBUG);
$handler->setFormatter(new JsonFormatter());
$log->pushHandler($handler);
Expand Down Expand Up @@ -219,7 +220,7 @@ public function processItem($data)
'batch_size' => max Number of UUIDs/ADOS to process per Queue entry, defaults to 50,
];
*/
if ($data->pluginconfig->op !== "action") {
if ($data->pluginconfig->op !== "action") {
return;
}

Expand All @@ -245,8 +246,8 @@ public function processItem($data)
'setid' => $data->info['set_id'] ?? NULL,
'time_submitted' => $data->info['time_submitted'] ?? '',
]);
return;
}
return;
}

private function processAction($data): bool|null {
Expand Down Expand Up @@ -319,6 +320,7 @@ private function processAction($data): bool|null {
'time_submitted' => $data->info['time_submitted'] ?? '',
]);
$success = TRUE;

}
catch (EntityStorageException $e) {
$message = $this->t('Error executing @action on ADOs via Set @setid.', [
Expand Down

0 comments on commit d432e70

Please sign in to comment.