Model/HealthModel.php
public function setCache()
    {
        if (!$this->cache) {
            $this->cache = new CacheStorageHelper(
                CacheStorageHelper::ADAPTOR_DATABASE,
                'Health',
                $this->em->getConnection()
            );
        }
        usort(
            $this->delays,
            function ($a, $b) {
                return $b['avg_delay_s'] - $a['avg_delay_s'];
            }
        );
        $this->cache->set('delays', $this->delays, null);
        $this->cache->set('lastCached', time(), null);
        $this->delays = [];
    }
public function setCache()
    {
        if (!$this->cache) {
            $this->cache = new CacheStorageHelper(
                CacheStorageHelper::ADAPTOR_DATABASE,
                'Health',
                $this->em->getConnection()
            );
        }
        usort(
            $this->delays,
            function ($a, $b) {
                return $b['avg_delay_s'] - $a['avg_delay_s'];
            }
        );
        $this->cache->set('delays', $this->delays, null);
        $this->cache->set('lastCached', time(), null);
        $this->delays = [];
    }
public function setCache ( ) { if ( ! $ this -> cache ) { $ this -> cache = new CacheStorageHelper ( CacheStorageHelper :: ADAPTOR_DATABASE , 'Health' , $ this -> em -> getConnection ( ) ) ; } usort ( $ this -> delays , function ( $ a , $ b ) { return $ b [ 'avg_delay_s' ] - $ a [ 'avg_delay_s' ] ; } ) ; $ this -> cache -> set ( 'delays' , $ this -> delays , null ) ; $ this -> cache -> set ( 'lastCached' , time ( ) , null ) ; $ this -> delays = [ ] ; }
Store current delays in the cache and purge.
Store current delays in the cache and purge .