Skip to content

Commit 34f3006

Browse files
committed
Delete old log records
1 parent 4f0d0a6 commit 34f3006

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/services/S3SyncService.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ public function getMatchingVolume($bucketName = '')
155155

156156
public function getLogs()
157157
{
158+
// Delete old records
159+
$date = (new \DateTime())->modify('-14 days')->format('Y-m-d H:i:s');
160+
S3SyncRecord::deleteAll(['<', 'dateCreated', $date]);
161+
158162
$records = S3SyncRecord::find()
159163
->with(['volume'])
160164
->orderBy('dateCreated DESC')

0 commit comments

Comments
 (0)