|
5 | 5 | use Algolia\AlgoliaSearch\Api\Product\ReplicaManagerInterface;
|
6 | 6 | use Algolia\AlgoliaSearch\Helper\Configuration\AutocompleteHelper;
|
7 | 7 | use Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper;
|
| 8 | +use Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper; |
8 | 9 | use Algolia\AlgoliaSearch\Service\AlgoliaConnector;
|
9 | 10 | use Algolia\AlgoliaSearch\Service\Serializer;
|
10 | 11 | use Magento\Cookie\Helper\Cookie as CookieHelper;
|
@@ -84,13 +85,6 @@ class ConfigHelper
|
84 | 85 | public const XML_PATH_IMAGE_HEIGHT = 'algoliasearch_images/image/height';
|
85 | 86 | public const XML_PATH_IMAGE_TYPE = 'algoliasearch_images/image/type';
|
86 | 87 |
|
87 |
| - // --- Indexing Queue / Cron --- // |
88 |
| - |
89 |
| - public const IS_ACTIVE = 'algoliasearch_queue/queue/active'; |
90 |
| - public const USE_BUILT_IN_CRON = 'algoliasearch_queue/queue/use_built_in_cron'; |
91 |
| - public const NUMBER_OF_JOB_TO_RUN = 'algoliasearch_queue/queue/number_of_job_to_run'; |
92 |
| - public const RETRY_LIMIT = 'algoliasearch_queue/queue/number_of_retries'; |
93 |
| - |
94 | 88 | // --- Indexing Manager --- //
|
95 | 89 |
|
96 | 90 | public const ENABLE_INDEXING = 'algoliasearch_indexing_manager/algolia_indexing/enable_indexing';
|
@@ -177,7 +171,8 @@ public function __construct(
|
177 | 171 | protected GroupExcludedWebsiteRepositoryInterface $groupExcludedWebsiteRepository,
|
178 | 172 | protected CookieHelper $cookieHelper,
|
179 | 173 | protected AutocompleteHelper $autocompleteConfig,
|
180 |
| - protected InstantSearchHelper $instantSearchConfig |
| 174 | + protected InstantSearchHelper $instantSearchConfig, |
| 175 | + protected QueueHelper $queueHelper |
181 | 176 | )
|
182 | 177 | {}
|
183 | 178 |
|
@@ -943,46 +938,6 @@ public function getImageType($storeId = null)
|
943 | 938 | return $this->configInterface->getValue(self::XML_PATH_IMAGE_TYPE, ScopeInterface::SCOPE_STORE, $storeId);
|
944 | 939 | }
|
945 | 940 |
|
946 |
| - // --- Indexing Queue / Cron --- // |
947 |
| - |
948 |
| - /** |
949 |
| - * @param $storeId |
950 |
| - * @return mixed |
951 |
| - */ |
952 |
| - public function getNumberOfJobToRun($storeId = null): int |
953 |
| - { |
954 |
| - $nbJobs = (int) $this->configInterface->getValue(self::NUMBER_OF_JOB_TO_RUN, ScopeInterface::SCOPE_STORE, $storeId); |
955 |
| - |
956 |
| - return (int) max($nbJobs, 1); |
957 |
| - } |
958 |
| - |
959 |
| - /** |
960 |
| - * @param $storeId |
961 |
| - * @return int |
962 |
| - */ |
963 |
| - public function getRetryLimit($storeId = null): int |
964 |
| - { |
965 |
| - return (int) $this->configInterface->getValue(self::RETRY_LIMIT, ScopeInterface::SCOPE_STORE, $storeId); |
966 |
| - } |
967 |
| - |
968 |
| - /** |
969 |
| - * @param $storeId |
970 |
| - * @return bool |
971 |
| - */ |
972 |
| - public function isQueueActive($storeId = null): bool |
973 |
| - { |
974 |
| - return $this->configInterface->isSetFlag(self::IS_ACTIVE, ScopeInterface::SCOPE_STORE, $storeId); |
975 |
| - } |
976 |
| - |
977 |
| - /** |
978 |
| - * @param $storeId |
979 |
| - * @return bool |
980 |
| - */ |
981 |
| - public function useBuiltInCron($storeId = null): bool |
982 |
| - { |
983 |
| - return $this->configInterface->isSetFlag(self::USE_BUILT_IN_CRON, ScopeInterface::SCOPE_STORE, $storeId); |
984 |
| - } |
985 |
| - |
986 | 941 | // --- Indexing Manager --- //
|
987 | 942 |
|
988 | 943 | /**
|
@@ -1740,6 +1695,32 @@ public function getCacheTime($storeId = null)
|
1740 | 1695 | */
|
1741 | 1696 | public const LEGACY_USE_VIRTUAL_REPLICA_ENABLED = 'algoliasearch_instant/instant/use_virtual_replica';
|
1742 | 1697 |
|
| 1698 | + // --- Indexing Queue / Cron --- // |
| 1699 | + |
| 1700 | + /** |
| 1701 | + * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release |
| 1702 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::IS_ACTIVE |
| 1703 | + */ |
| 1704 | + public const IS_ACTIVE = QueueHelper::IS_ACTIVE; |
| 1705 | + |
| 1706 | + /** |
| 1707 | + * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release |
| 1708 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::USE_BUILT_IN_CRON |
| 1709 | + */ |
| 1710 | + public const USE_BUILT_IN_CRON = QueueHelper::USE_BUILT_IN_CRON; |
| 1711 | + |
| 1712 | + /** |
| 1713 | + * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release |
| 1714 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::NUMBER_OF_JOB_TO_RUN |
| 1715 | + */ |
| 1716 | + public const NUMBER_OF_JOB_TO_RUN = QueueHelper::NUMBER_OF_JOB_TO_RUN; |
| 1717 | + |
| 1718 | + /** |
| 1719 | + * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release |
| 1720 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::RETRY_LIMIT |
| 1721 | + */ |
| 1722 | + public const RETRY_LIMIT = QueueHelper::RETRY_LIMIT; |
| 1723 | + |
1743 | 1724 | // --- Indexing Manager --- //
|
1744 | 1725 |
|
1745 | 1726 | /**
|
@@ -2088,6 +2069,52 @@ public function hidePaginationInInstantSearchPage($storeId = null)
|
2088 | 2069 | return $this->instantSearchConfig->shouldHidePagination($storeId);
|
2089 | 2070 | }
|
2090 | 2071 |
|
| 2072 | + // --- Indexing Queue / Cron --- // |
| 2073 | + |
| 2074 | + /** |
| 2075 | + * @param $storeId |
| 2076 | + * @return bool |
| 2077 | + * @deprecated This method has been moved to the Queue config helper and will be removed in a future version |
| 2078 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::isQueueActive() |
| 2079 | + */ |
| 2080 | + public function isQueueActive($storeId = null) |
| 2081 | + { |
| 2082 | + return $this->queueHelper->isQueueActive($storeId); |
| 2083 | + } |
| 2084 | + |
| 2085 | + /** |
| 2086 | + * @param $storeId |
| 2087 | + * @return bool |
| 2088 | + * @deprecated This method has been moved to the Queue config helper and will be removed in a future version |
| 2089 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::useBuiltInCron() |
| 2090 | + */ |
| 2091 | + public function useBuiltInCron($storeId = null) |
| 2092 | + { |
| 2093 | + return $this->queueHelper->useBuiltInCron($storeId); |
| 2094 | + } |
| 2095 | + |
| 2096 | + /** |
| 2097 | + * @param $storeId |
| 2098 | + * @return bool |
| 2099 | + * @deprecated This method has been moved to the Queue config helper and will be removed in a future version |
| 2100 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::getNumberOfJobToRun() |
| 2101 | + */ |
| 2102 | + public function getNumberOfJobToRun($storeId = null) |
| 2103 | + { |
| 2104 | + return $this->queueHelper->getNumberOfJobToRun($storeId); |
| 2105 | + } |
| 2106 | + |
| 2107 | + /** |
| 2108 | + * @param $storeId |
| 2109 | + * @return bool |
| 2110 | + * @deprecated This method has been moved to the Queue config helper and will be removed in a future version |
| 2111 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::getRetryLimit() |
| 2112 | + */ |
| 2113 | + public function getRetryLimit($storeId = null) |
| 2114 | + { |
| 2115 | + return $this->queueHelper->getRetryLimit($storeId); |
| 2116 | + } |
| 2117 | + |
2091 | 2118 | // --- Indexing Manager --- //
|
2092 | 2119 |
|
2093 | 2120 | /**
|
|
0 commit comments