Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db49d36a authored by Arnau Vàzquez's avatar Arnau Vàzquez
Browse files

Merge branch 'cpu-memory-usage-issue' into 'master'

removed unnecessary iteration of folders

See merge request e/os/LineageOTA!26
parents dc4289a1 b57b7a4e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@
            });

            // LineageOS new API
            Flight::route('/api/v1/@deviceType(/@romType(/@incrementalVersion))', function ( $deviceType, $romType, $incrementalVersion ){
            Flight::route('/api/v1/@deviceType/@romType(/@incrementalVersion)', function ( $deviceType, $romType, $incrementalVersion ){
              Flight::builds()->setPostData(
                array(
                  'params' => array(
+42 −41
Original line number Diff line number Diff line
@@ -158,21 +158,22 @@

        private function getBuilds()
        {
            $params = $this->postData['params'];
            
            $device = isset($params['device']) ? $params['device'] : '';
            $channels = isset($params['channels']) ? $params['channels'][0] : '';

            // Get physical paths of where the files resides
            $path = Flight::cfg()->get('realBasePath') . '/builds/full';
            // Get subdirs
            $dirs = glob($path . '/*', GLOB_ONLYDIR);
            $subdirs = [];
            foreach ($dirs as $subdir) {
                $newSubdirs = glob($subdir . '/*', GLOB_ONLYDIR);
                $subdirs = array_merge($subdirs, $newSubdirs);
            }
            $dirs = array_merge($dirs, $subdirs);
            array_push($dirs, $path);
            foreach ($dirs as $dir) {
            
            $dir = $path . '/' . $channels . '/' . $device;
            if(!is_dir($dir)){
                return;
            }
            // Get the file list and parse it
            $files = scandir($dir);
                if (count($files) > 0) {
            if (count($files) > 2) {
                
                foreach ($files as $file) {
                    $filename = pathinfo($file, PATHINFO_FILENAME);

@@ -213,6 +214,6 @@
                    }
                }
            }
            }
            $this->logger->debug('Total execution  time  of getBuilds in seconds');
        }
    }
+1 −1

File changed.

Contains only whitespace changes.