File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 2929
3030class TaskProcessingService {
3131 private ?ICache $ cache = null ;
32+ private ?array $ registeredProviders = null ;
3233
3334 public function __construct (
3435 ICacheFactory $ cacheFactory ,
@@ -47,14 +48,17 @@ public function __construct(
4748 */
4849 public function getRegisteredTaskProcessingProviders (): array {
4950 try {
51+ if ($ this ->registeredProviders !== null ) {
52+ return $ this ->registeredProviders ;
53+ }
5054 $ cacheKey = '/ex_task_processing_providers ' ;
5155 $ records = $ this ->cache ?->get($ cacheKey );
5256 if ($ records === null ) {
5357 $ records = $ this ->mapper ->findAllEnabled ();
5458 $ this ->cache ?->set($ cacheKey , $ records );
5559 }
5660
57- return array_map (static function ($ record ) {
61+ return $ this -> registeredProviders = array_map (static function ($ record ) {
5862 return new TaskProcessingProvider ($ record );
5963 }, $ records );
6064 } catch (Exception ) {
You can’t perform that action at this time.
0 commit comments