From 7f5c171779200b06e29eaca728468ab0256d11e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrgen=20Haas?=
 <21467-jurgenhaas@users.noreply.drupalcode.org>
Date: Sat, 25 Jan 2025 13:44:39 +0000
Subject: [PATCH] Issue #3501146: Installation fails if cron runs in parallel

---
 .../config/eca.eca.init_search.yml            | 24 +++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/recipes/drupal_cms_starter/config/eca.eca.init_search.yml b/recipes/drupal_cms_starter/config/eca.eca.init_search.yml
index 8a0336603..a023b57e8 100644
--- a/recipes/drupal_cms_starter/config/eca.eca.init_search.yml
+++ b/recipes/drupal_cms_starter/config/eca.eca.init_search.yml
@@ -12,7 +12,7 @@ dependencies:
 id: init_search
 modeller: fallback
 label: 'Initialize search index'
-version: 1.0.0
+version: 1.0.1
 weight: 0
 events:
   Event_write_config:
@@ -42,12 +42,21 @@ conditions:
       operator: equal
       type: value
       negate: true
+  Flow_install_time_is_set:
+    plugin: eca_scalar
+    configuration:
+      negate: false
+      case: false
+      left: '[install_time]'
+      right: '1'
+      operator: greaterthan
+      type: numeric
 gateways:
   Gateway_and_1:
     type: 0
     successors:
       -
-        id: Activity_reset_last_cron_run
+        id: Activity_load_install_time
         condition: Flow_is_new
 actions:
   Activity_reset_last_cron_run:
@@ -60,3 +69,14 @@ actions:
       use_yaml: false
       ifnotexists: false
     successors: {  }
+  Activity_load_install_time:
+    plugin: eca_keyvaluestore_read
+    label: 'Load install time'
+    configuration:
+      collection: state
+      key: install_time
+      token_name: install_time
+    successors:
+      -
+        id: Activity_reset_last_cron_run
+        condition: Flow_install_time_is_set
-- 
GitLab