forked from verdnatura/hedera-web
Image sync script fixes
This commit is contained in:
parent
079e9266f1
commit
989730a905
|
@ -1,4 +1,4 @@
|
|||
hedera-web (1.407.28) stable; urgency=low
|
||||
hedera-web (1.407.29) stable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "hedera-web",
|
||||
"version": "1.407.28",
|
||||
"version": "1.407.29",
|
||||
"description": "Verdnatura web page",
|
||||
"license": "GPL-3.0",
|
||||
"repository": {
|
||||
|
|
|
@ -59,8 +59,11 @@ class Sync extends Vn\Lib\Method {
|
|||
['collection' => $collection]
|
||||
);
|
||||
|
||||
if ($res->num_rows == 0) continue;
|
||||
echo "Deleting {$res->num_rows} from collection '$collection'.\n";
|
||||
|
||||
while ($image = $res->fetch_object())
|
||||
if (!empty($image) && !in_array($image->name, ['.', '..'])) {
|
||||
if (!empty($image->name) && !in_array($image->name, ['.', '..'])) {
|
||||
$deleteCount++;
|
||||
$this->recycle("$collection/full/{$image->name}.png");
|
||||
|
||||
|
@ -78,6 +81,7 @@ class Sync extends Vn\Lib\Method {
|
|||
$db->query('COMMIT');
|
||||
} catch(Exception $e) {
|
||||
$db->query('ROLLBACK');
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue