Skip to content

Commit 2da43ab

Browse files
committed
Extend Cleanup job to delete old traces (6+ months)
1 parent 62db05f commit 2da43ab

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

app/Jobs/Cleanup.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use App\Models\Tenant;
1111
use App\Models\TimelineFact;
1212
use App\Models\TimelineItem;
13+
use App\Models\Trace;
1314
use App\Models\Trial;
1415
use App\Models\User;
1516
use App\Models\Vector;
@@ -128,6 +129,8 @@ public function handle()
128129
Log::debug("Vectors with missing references for user {$user->email} removed.");
129130
Log::debug("Purging conversations of user {$user->email} that are over 6 months old...");
130131

132+
Trace::where('updated_at', '<=', Carbon::now()->startOfDay()->subMonths(6))
133+
->delete();
131134
Conversation::where('updated_at', '<=', Carbon::now()->startOfDay()->subMonths(6))
132135
->delete();
133136

0 commit comments

Comments
 (0)