Skip to content

Commit b1d1d8c

Browse files
committed
Remove unlink
We can't rely on this file being used. Instead we can log errors and let the application developer take care of removing their database file. Refs #1022
1 parent acfbc05 commit b1d1d8c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: src/Model/Table/RequestsTable.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,12 @@ public function gc(): void
157157

158158
try {
159159
$conn->execute('VACUUM;');
160-
} catch (PDOException) {
161-
// phpcs:disable
162-
@unlink(TMP . 'debug_kit.sqlite');
163-
// phpcs:enable
160+
} catch (PDOException $e) {
161+
Log::warning(
162+
'Unable to run VACUUM on debug kit SQLite database. ' .
163+
'Please manually remove the database file'
164+
);
165+
Log::warning((string)$e);
164166
}
165167
}
166168
} catch (PDOException $e) {

0 commit comments

Comments
 (0)