Skip to content

Commit 739d378

Browse files
committed
90 Day cache cleanup
1 parent f690b6d commit 739d378

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

Modules/CIPPCore/Public/Entrypoints/Timer Functions/Start-TableCleanup.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ function Start-TableCleanup {
105105
Property = @('PartitionKey', 'RowKey', 'ETag')
106106
}
107107
}
108+
@{
109+
FunctionName = 'TableCleanupTask'
110+
Type = 'CleanupRule'
111+
TableName = 'knownlocationdbv2'
112+
DataTableProps = @{
113+
Filter = "PartitionKey eq 'ip' and Timestamp lt datetime'$((Get-Date).AddDays(-90).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ'))'"
114+
First = 10000
115+
Property = @('PartitionKey', 'RowKey', 'ETag')
116+
}
117+
}
108118
@{
109119
FunctionName = 'TableCleanupTask'
110120
Type = 'DeleteTable'

Modules/CIPPCore/Public/Get-CIPPGeoIPLocationBatch.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function Get-CIPPGeoIPLocationBatch {
6363
if ($Distinct.Count -eq 0) { return $Result }
6464

6565
$LocationTable = Get-CIPPTable -TableName 'knownlocationdbv2'
66-
$ValidAfter = (Get-Date).AddDays(-30).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ')
66+
$ValidAfter = (Get-Date).AddDays(-90).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ')
6767

6868
# 1) Seed from knownlocationdbv2 (fresh, non-Unknown entries); collect the misses
6969
$ToResolve = [System.Collections.Generic.List[string]]::new()

0 commit comments

Comments
 (0)