Commit 55fa8c87 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Fix : Update après réindexation

parent fbebbb21
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@
    "symfony/filesystem": "^7.1",
    "vlucas/phpdotenv": "^5.6",
    "symfony/config": "^7.2",
    "ext-calendar": "*"
    "ext-calendar": "*",
    "ext-gearman": "^2.2"
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
+3 −2
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
        "This file is @generated automatically"
    ],
    "content-hash": "e4452fd9ac848add5517cba58275f6a7",
    "content-hash": "e1b74af972da5cd298d44d5da7bddd08",
    "packages": [
        {
            "name": "apereo/phpcas",
@@ -11528,7 +11528,8 @@
        "php": ">=8.2",
        "ext-gettext": "*",
        "ext-fileinfo": "*",
        "ext-calendar": "*"
        "ext-calendar": "*",
        "ext-gearman": "^2.2"
    },
    "platform-dev": [],
    "plugin-api-version": "2.2.0"
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ class OscarConsoleCommand extends OscarCommandAbstract

        $params = json_decode($input->getArgument('params'), true);

        $this->getServicemanager()->get('Logger')->debug("command : $action " . $input->getArgument('params'));
        $this->getServicemanager()->get('Logger')->info("[command] : $action " . $input->getArgument('params'));

        switch ($action) {
            case "notificationsactivity":
+2 −1
Original line number Diff line number Diff line
@@ -1931,7 +1931,8 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
        try {
            $id = $this->params()->fromRoute('id');
            $activity = $this->getActivityFromRoute();
            $this->getProjectGrantService()->getGearmanJobLauncherService()->triggerUpdateSearchIndexActivity($activity);
            $this->getProjectGrantService()->searchUpdate($activity);
            // $this->getProjectGrantService()->getGearmanJobLauncherService()->triggerUpdateSearchIndexActivity($activity);
            if( $this->isAjax() ){
                return $this->getResponseOk("réindexation déclenchée");
            }
+7 −3
Original line number Diff line number Diff line
@@ -312,14 +312,18 @@ abstract class ElasticSearchEngine
    {
        $params = [
            'index' => $this->getIndex(),
            'id' => $item->getId(),
            'id' => (string) $item->getId(),
            'body' => [
                'doc' => $this->getIndexableDatas($item)
                'doc' => $this->getIndexableDatas($item),
                'doc_as_upsert' => true
            ]
        ];

        $this->loggerService->info("[elasticsearch] update " . json_encode($params));
        try {
            return $this->getClient()->update($params)->asArray();
            $reindex = $this->getClient()->update($params)->asArray();
            $this->getClient()->indices()->refresh(['index' => $this->getIndex()]);
            return $reindex;
        } catch (\Exception $e) {
            throw new OscarException(
                sprintf(
Loading