Update cache only when there are changes

This commit is contained in:
mkuba50 2017-10-10 19:38:04 +02:00
parent 181198d077
commit 496e015611
2 changed files with 15 additions and 5 deletions

View File

@ -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($newDb != $database) {
if(!file_exists('cache')) mkdir('cache');
$success = @file_put_contents('cache/fileinfo.json', json_encode($newDb)."\n");
$success = @file_put_contents(
'cache/fileinfo.json',
json_encode($newDb)."\n"
);
if(!$success) consoleLogger('Failed to update database cache.');
}
return array(
'apiVersion' => uupApiVersion(),

View File

@ -16,7 +16,7 @@ limitations under the License.
*/
function uupApiVersion() {
return '1.1.0';
return '1.1.1';
}
function uupApiPrintBrand() {