|
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;
|
@@ -42,11 +43,6 @@ class ConfigHelper
|
42 | 43 | public const INDEX_EMPTY_CATEGORIES = 'algoliasearch_categories/categories/index_empty_categories';
|
43 | 44 | public const CATEGORY_SEPARATOR = 'algoliasearch_categories/categories/category_separator';
|
44 | 45 |
|
45 |
| - public const IS_ACTIVE = 'algoliasearch_queue/queue/active'; |
46 |
| - public const USE_BUILT_IN_CRON = 'algoliasearch_queue/queue/use_built_in_cron'; |
47 |
| - public const NUMBER_OF_JOB_TO_RUN = 'algoliasearch_queue/queue/number_of_job_to_run'; |
48 |
| - public const RETRY_LIMIT = 'algoliasearch_queue/queue/number_of_retries'; |
49 |
| - |
50 | 46 | public const XML_PATH_IMAGE_WIDTH = 'algoliasearch_images/image/width';
|
51 | 47 | public const XML_PATH_IMAGE_HEIGHT = 'algoliasearch_images/image/height';
|
52 | 48 | public const XML_PATH_IMAGE_TYPE = 'algoliasearch_images/image/type';
|
@@ -156,7 +152,8 @@ public function __construct(
|
156 | 152 | protected GroupExcludedWebsiteRepositoryInterface $groupExcludedWebsiteRepository,
|
157 | 153 | protected CookieHelper $cookieHelper,
|
158 | 154 | protected AutocompleteHelper $autocompleteConfig,
|
159 |
| - protected InstantSearchHelper $instantSearchConfig |
| 155 | + protected InstantSearchHelper $instantSearchConfig, |
| 156 | + protected QueueHelper $queueHelper |
160 | 157 | )
|
161 | 158 | {}
|
162 | 159 |
|
@@ -384,44 +381,6 @@ public function getNumberOfElementByPage($storeId = null)
|
384 | 381 | return (int)$this->configInterface->getValue(self::NUMBER_OF_ELEMENT_BY_PAGE, ScopeInterface::SCOPE_STORE, $storeId);
|
385 | 382 | }
|
386 | 383 |
|
387 |
| - /** |
388 |
| - * @param $storeId |
389 |
| - * @return mixed |
390 |
| - */ |
391 |
| - public function getNumberOfJobToRun($storeId = null) |
392 |
| - { |
393 |
| - $nbJobs = (int)$this->configInterface->getValue(self::NUMBER_OF_JOB_TO_RUN, ScopeInterface::SCOPE_STORE, $storeId); |
394 |
| - |
395 |
| - return max($nbJobs, 1); |
396 |
| - } |
397 |
| - |
398 |
| - /** |
399 |
| - * @param $storeId |
400 |
| - * @return int |
401 |
| - */ |
402 |
| - public function getRetryLimit($storeId = null) |
403 |
| - { |
404 |
| - return (int)$this->configInterface->getValue(self::RETRY_LIMIT, ScopeInterface::SCOPE_STORE, $storeId); |
405 |
| - } |
406 |
| - |
407 |
| - /** |
408 |
| - * @param $storeId |
409 |
| - * @return bool |
410 |
| - */ |
411 |
| - public function isQueueActive($storeId = null) |
412 |
| - { |
413 |
| - return $this->configInterface->isSetFlag(self::IS_ACTIVE, ScopeInterface::SCOPE_STORE, $storeId); |
414 |
| - } |
415 |
| - |
416 |
| - /** |
417 |
| - * @param $storeId |
418 |
| - * @return bool |
419 |
| - */ |
420 |
| - public function useBuiltInCron($storeId = null) |
421 |
| - { |
422 |
| - return $this->configInterface->isSetFlag(self::USE_BUILT_IN_CRON, ScopeInterface::SCOPE_STORE, $storeId); |
423 |
| - } |
424 |
| - |
425 | 384 | /**
|
426 | 385 | * @param $storeId
|
427 | 386 | * @return bool
|
@@ -1715,6 +1674,32 @@ public function isQueueIndexerEnabled(): bool
|
1715 | 1674 | */
|
1716 | 1675 | public const LEGACY_USE_VIRTUAL_REPLICA_ENABLED = 'algoliasearch_instant/instant/use_virtual_replica';
|
1717 | 1676 |
|
| 1677 | + // --- Indexing Queue --- // |
| 1678 | + |
| 1679 | + /** |
| 1680 | + * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release |
| 1681 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::IS_ACTIVE |
| 1682 | + */ |
| 1683 | + public const IS_ACTIVE = QueueHelper::IS_ACTIVE; |
| 1684 | + |
| 1685 | + /** |
| 1686 | + * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release |
| 1687 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::USE_BUILT_IN_CRON |
| 1688 | + */ |
| 1689 | + public const USE_BUILT_IN_CRON = QueueHelper::USE_BUILT_IN_CRON; |
| 1690 | + |
| 1691 | + /** |
| 1692 | + * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release |
| 1693 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::NUMBER_OF_JOB_TO_RUN |
| 1694 | + */ |
| 1695 | + public const NUMBER_OF_JOB_TO_RUN = QueueHelper::NUMBER_OF_JOB_TO_RUN; |
| 1696 | + |
| 1697 | + /** |
| 1698 | + * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release |
| 1699 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::RETRY_LIMIT |
| 1700 | + */ |
| 1701 | + public const RETRY_LIMIT = QueueHelper::RETRY_LIMIT; |
| 1702 | + |
1718 | 1703 | // --- Indexing Manager --- //
|
1719 | 1704 |
|
1720 | 1705 | /**
|
@@ -2045,6 +2030,52 @@ public function hidePaginationInInstantSearchPage($storeId = null)
|
2045 | 2030 | return $this->instantSearchConfig->shouldHidePagination($storeId);
|
2046 | 2031 | }
|
2047 | 2032 |
|
| 2033 | + // --- Indexing Queue --- // |
| 2034 | + |
| 2035 | + /** |
| 2036 | + * @param $storeId |
| 2037 | + * @return bool |
| 2038 | + * @deprecated This method has been moved to the Queue config helper and will be removed in a future version |
| 2039 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::isQueueActive() |
| 2040 | + */ |
| 2041 | + public function isQueueActive($storeId = null) |
| 2042 | + { |
| 2043 | + return $this->queueHelper->isQueueActive($storeId); |
| 2044 | + } |
| 2045 | + |
| 2046 | + /** |
| 2047 | + * @param $storeId |
| 2048 | + * @return bool |
| 2049 | + * @deprecated This method has been moved to the Queue config helper and will be removed in a future version |
| 2050 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::useBuiltInCron() |
| 2051 | + */ |
| 2052 | + public function useBuiltInCron($storeId = null) |
| 2053 | + { |
| 2054 | + return $this->queueHelper->useBuiltInCron($storeId); |
| 2055 | + } |
| 2056 | + |
| 2057 | + /** |
| 2058 | + * @param $storeId |
| 2059 | + * @return bool |
| 2060 | + * @deprecated This method has been moved to the Queue config helper and will be removed in a future version |
| 2061 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::getNumberOfJobToRun() |
| 2062 | + */ |
| 2063 | + public function getNumberOfJobToRun($storeId = null) |
| 2064 | + { |
| 2065 | + return $this->queueHelper->getNumberOfJobToRun($storeId); |
| 2066 | + } |
| 2067 | + |
| 2068 | + /** |
| 2069 | + * @param $storeId |
| 2070 | + * @return bool |
| 2071 | + * @deprecated This method has been moved to the Queue config helper and will be removed in a future version |
| 2072 | + * @see \Algolia\AlgoliaSearch\Helper\Configuration\QueueHelper::getRetryLimit() |
| 2073 | + */ |
| 2074 | + public function getRetryLimit($storeId = null) |
| 2075 | + { |
| 2076 | + return $this->queueHelper->getRetryLimit($storeId); |
| 2077 | + } |
| 2078 | + |
2048 | 2079 | // --- Indexing Manager --- //
|
2049 | 2080 |
|
2050 | 2081 | /**
|
|
0 commit comments