Skip to content

Commit

Permalink
run VACUUM command to free disc space
Browse files Browse the repository at this point in the history
  • Loading branch information
David Albrecht committed Oct 8, 2019
1 parent 0ea1b56 commit b061210
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Model/Table/RequestsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace DebugKit\Model\Table;

use Cake\Core\Configure;
use Cake\Database\Driver\Sqlite;
use Cake\ORM\Query;
use Cake\ORM\Table;
use DebugKit\Model\Entity\Request;
Expand Down Expand Up @@ -108,5 +109,10 @@ public function gc()

$statement = $query->execute();
$statement->closeCursor();

$conn = $this->getConnection();
if ($conn->getDriver() instanceof Sqlite) {
$conn->execute('VACUUM;');
}
}
}

0 comments on commit b061210

Please sign in to comment.