Fix develop Node Version reported as outdated (#1272)
				
					
				
			This commit is contained in:
		
							parent
							
								
									a186900262
								
							
						
					
					
						commit
						ffd94b8892
					
				| @ -14,9 +14,9 @@ class NodeVersionsCheck extends Check | |||||||
| 
 | 
 | ||||||
|     public function run(): Result |     public function run(): Result | ||||||
|     { |     { | ||||||
|         $all = Node::query()->count(); |         $all = Node::all(); | ||||||
| 
 | 
 | ||||||
|         if ($all === 0) { |         if ($all->isEmpty()) { | ||||||
|             $result = Result::make() |             $result = Result::make() | ||||||
|                 ->notificationMessage(trans('admin/health.results.nodeversions.no_nodes_created')) |                 ->notificationMessage(trans('admin/health.results.nodeversions.no_nodes_created')) | ||||||
|                 ->shortSummary(trans('admin/health.results.nodeversions.no_nodes')); |                 ->shortSummary(trans('admin/health.results.nodeversions.no_nodes')); | ||||||
| @ -25,16 +25,18 @@ class NodeVersionsCheck extends Check | |||||||
|             return $result; |             return $result; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         $latestVersion = $this->versionService->latestWingsVersion(); |         $outdated = $all | ||||||
| 
 |             ->filter(fn (Node $node) => !isset($node->systemInformation()['exception']) && !$this->versionService->isLatestWings($node->systemInformation()['version'])) | ||||||
|         $outdated = Node::query()->get() |  | ||||||
|             ->filter(fn (Node $node) => !isset($node->systemInformation()['exception']) && $node->systemInformation()['version'] !== $latestVersion) |  | ||||||
|             ->count(); |             ->count(); | ||||||
| 
 | 
 | ||||||
|  |         $all = $all->count(); | ||||||
|  |         $latestVersion = $this->versionService->latestWingsVersion(); | ||||||
|  | 
 | ||||||
|         $result = Result::make() |         $result = Result::make() | ||||||
|             ->meta([ |             ->meta([ | ||||||
|                 'all' => $all, |                 'all' => $all, | ||||||
|                 'outdated' => $outdated, |                 'outdated' => $outdated, | ||||||
|  |                 'latestVersion' => $latestVersion, | ||||||
|             ]) |             ]) | ||||||
|             ->shortSummary($outdated === 0 ? trans('admin/health.results.nodeversions.all_up_to_date') : trans('admin/health.results.nodeversions.outdated', ['outdated' => $outdated, 'all' => $all])); |             ->shortSummary($outdated === 0 ? trans('admin/health.results.nodeversions.all_up_to_date') : trans('admin/health.results.nodeversions.outdated', ['outdated' => $outdated, 'all' => $all])); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 MartinOscar
						MartinOscar