{
"name": "uguu",
- "version": "1.8.1",
+ "version": "1.8.2",
"description": "Uguu is a simple lightweight temporary file host with support for drop, paste, click and API uploading.",
"homepage": "https://uguu.se",
"repository": {
}
}
+ public function cleanRateLimitDB(): void {
+ $query = match ($this->dbType) {
+ 'pgsql' => 'DELETE FROM ratelimit WHERE time < EXTRACT(epoch from NOW() - INTERVAL \'24 HOURS\')',
+ default => 'DELETE FROM ratelimit WHERE time <= strftime(\'%s\', datetime(\'now\', \'-24 HOURS\'));'
+ };
+ $q = $this->DB->prepare($query);
+ $q->execute();
+ $q->closeCursor();
+ }
public function deleteFiles(array $filenames): void {
foreach ($filenames as $filename) {
unlink($this->CONFIG['FILES_ROOT'] . $filename);
$check = new expireChecker();
$dbResult = $check->checkDB();
-
+$check->cleanRateLimitDB();
if(empty($dbResult['ids'])){
echo "No file(s) expired, nothing to do.";
} else {