Skip to content

Commit

Permalink
Merge pull request #702 from davalb/vacuum
Browse files Browse the repository at this point in the history
run VACUUM command to free disc space
  • Loading branch information
markstory authored Oct 9, 2019
2 parents 0ea1b56 + b061210 commit 684016c
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 684016c

Please sign in to comment.