Update cache only when there are changes
This commit is contained in:
		
							
								
								
									
										18
									
								
								listid.php
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								listid.php
									
									
									
									
									
								
							| @@ -67,7 +67,10 @@ function uupListIds() { | ||||
|             'uuid' => $uuid, | ||||
|         ); | ||||
|  | ||||
|         $builds = array_merge($builds, array($build.$arch.$title.$uuid => $temp)); | ||||
|         $builds = array_merge( | ||||
|             $builds, | ||||
|             array($build.$arch.$title.$uuid => $temp) | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     krsort($builds); | ||||
| @@ -81,9 +84,16 @@ function uupListIds() { | ||||
|  | ||||
|     consoleLogger('Done parsing database info.'); | ||||
|  | ||||
|     if(!file_exists('cache')) mkdir('cache'); | ||||
|     $success = @file_put_contents('cache/fileinfo.json', json_encode($newDb)."\n"); | ||||
|     if(!$success) consoleLogger('Failed to update database cache.'); | ||||
|     if($newDb != $database) { | ||||
|         if(!file_exists('cache')) mkdir('cache'); | ||||
|  | ||||
|         $success = @file_put_contents( | ||||
|             'cache/fileinfo.json', | ||||
|             json_encode($newDb)."\n" | ||||
|         ); | ||||
|  | ||||
|         if(!$success) consoleLogger('Failed to update database cache.'); | ||||
|     } | ||||
|  | ||||
|     return array( | ||||
|         'apiVersion' => uupApiVersion(), | ||||
|   | ||||
| @@ -16,7 +16,7 @@ limitations under the License. | ||||
| */ | ||||
|  | ||||
| function uupApiVersion() { | ||||
|     return '1.1.0'; | ||||
|     return '1.1.1'; | ||||
| } | ||||
|  | ||||
| function uupApiPrintBrand() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user