You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$failedEntity=Get-CIPPAzDataTableEntity@FailedDownloadsTable-Filter "PartitionKey eq '$TenantFilter' and SearchId eq '$SearchId' and Timestamp ge datetime'$($fourHoursAgo.ToString('yyyy-MM-ddTHH:mm:ssZ'))'"
20
+
21
+
if ($failedEntity) {
22
+
$message="Skipping search ID: $SearchId for tenant: $TenantFilter - Previous attempt failed within the last 4 hours"
Write-Information"Recorded download attempt for search ID: $SearchId, tenant: $TenantFilter"
56
+
} catch {
57
+
Write-Information"Failed to record download attempt: $($_.Exception.Message)"
58
+
}
59
+
22
60
$downloadStartTime=Get-Date
23
-
# Process each search and store results in cache
24
61
try {
25
62
Write-Information"Processing search ID: $($SearchId) for tenant: $TenantFilter"
26
-
# Get the search results
27
-
#check if we haven't already downloaded this search by checking the cache table, if there are items with the same search id and tenant, we skip this search
28
-
$searchEntity=Get-CIPPAzDataTableEntity@CacheWebhooksTable-Filter "PartitionKey eq '$TenantFilter' and SearchId eq '$SearchId'"
29
-
if ($searchEntity) {
30
-
Write-Information"Search ID: $SearchId already cached for tenant: $TenantFilter"
0 commit comments