File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424
2525class TaskProcessingService {
2626 private ?ICache $ cache = null ;
27+ private ?array $ registeredProviders = null ;
2728
2829 public function __construct (
2930 ICacheFactory $ cacheFactory ,
@@ -42,14 +43,17 @@ public function __construct(
4243 */
4344 public function getRegisteredTaskProcessingProviders (): array {
4445 try {
46+ if ($ this ->registeredProviders !== null ) {
47+ return $ this ->registeredProviders ;
48+ }
4549 $ cacheKey = '/ex_task_processing_providers ' ;
4650 $ records = $ this ->cache ?->get($ cacheKey );
4751 if ($ records === null ) {
4852 $ records = $ this ->mapper ->findAllEnabled ();
4953 $ this ->cache ?->set($ cacheKey , $ records );
5054 }
5155
52- return array_map (static function ($ record ) {
56+ return $ this -> registeredProviders = array_map (static function ($ record ) {
5357 return new TaskProcessingProvider ($ record );
5458 }, $ records );
5559 } catch (Exception ) {
You can’t perform that action at this time.
0 commit comments