v1.2.0: Immediate processing after eDNC download
- Reduced initial delay from stability check to 50ms - Aggressive retry starting at 100ms (was 500ms) - 15 retry attempts for longer lock holds - Processes immediately when file becomes available 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -129,6 +129,7 @@ The script uses exponential backoff (500ms → 1s → 2s → 4s → up to 16s) f
|
|||||||
|
|
||||||
| Version | Date | Changes |
|
| Version | Date | Changes |
|
||||||
|---------|------|---------|
|
|---------|------|---------|
|
||||||
|
| 1.2.0 | 2025-12-12 | Immediate processing: 50ms delay, aggressive retry (100ms+), 15 attempts |
|
||||||
| 1.1.0 | 2025-12-12 | Improved file locking: stability check, exponential backoff, debouncing |
|
| 1.1.0 | 2025-12-12 | Improved file locking: stability check, exponential backoff, debouncing |
|
||||||
| 1.0.0 | 2025-12-12 | Initial release |
|
| 1.0.0 | 2025-12-12 | Initial release |
|
||||||
|
|
||||||
|
|||||||
@@ -36,14 +36,14 @@
|
|||||||
|
|
||||||
.NOTES
|
.NOTES
|
||||||
Author: GE Aerospace - Rutland
|
Author: GE Aerospace - Rutland
|
||||||
Version: 1.1.0
|
Version: 1.2.0
|
||||||
Date: 2025-12-12
|
Date: 2025-12-12
|
||||||
|
|
||||||
v1.1.0 - Improved file locking handling:
|
v1.2.0 - Immediate processing:
|
||||||
- Wait for file to stabilize (size stops changing)
|
- Process file immediately when eDNC releases it (50ms initial delay)
|
||||||
- Exponential backoff retry (500ms -> 16s)
|
- Aggressive retry: 100ms -> 200ms -> 400ms -> 800ms (15 attempts)
|
||||||
- Up to 10 retry attempts
|
|
||||||
- Debouncing to prevent duplicate processing
|
- Debouncing to prevent duplicate processing
|
||||||
|
- Exclusive file lock for atomic read/write
|
||||||
|
|
||||||
Common problematic characters:
|
Common problematic characters:
|
||||||
- 0xFF (255) - Padding/fill character
|
- 0xFF (255) - Padding/fill character
|
||||||
@@ -68,7 +68,7 @@ param(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Script info
|
# Script info
|
||||||
$ScriptVersion = "1.1.0"
|
$ScriptVersion = "1.2.0"
|
||||||
$ScriptName = "eDNC Special Character Fix"
|
$ScriptName = "eDNC Special Character Fix"
|
||||||
|
|
||||||
# Display banner
|
# Display banner
|
||||||
@@ -132,38 +132,13 @@ $action = {
|
|||||||
|
|
||||||
Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') | $changeType | $fileName" -ForegroundColor White
|
Write-Host "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') | $changeType | $fileName" -ForegroundColor White
|
||||||
|
|
||||||
# STEP 1: Wait for file to stabilize (size stops changing)
|
# Brief initial delay to let eDNC finish (50ms)
|
||||||
$stableChecks = 0
|
Start-Sleep -Milliseconds 50
|
||||||
$lastSize = -1
|
|
||||||
$maxStableWait = 30 # Max 30 seconds waiting for file to stabilize
|
|
||||||
|
|
||||||
while ($stableChecks -lt $maxStableWait) {
|
# Try to acquire exclusive access - process immediately when available
|
||||||
Start-Sleep -Milliseconds 500
|
$maxRetries = 15
|
||||||
try {
|
|
||||||
if (-not (Test-Path $path)) {
|
|
||||||
Write-Host " [SKIP] File no longer exists" -ForegroundColor Yellow
|
|
||||||
return
|
|
||||||
}
|
|
||||||
$currentSize = (Get-Item $path).Length
|
|
||||||
if ($currentSize -eq $lastSize -and $currentSize -gt 0) {
|
|
||||||
# File size hasn't changed - likely done writing
|
|
||||||
break
|
|
||||||
}
|
|
||||||
$lastSize = $currentSize
|
|
||||||
$stableChecks++
|
|
||||||
if ($stableChecks % 4 -eq 0) {
|
|
||||||
Write-Host " [WAIT] File still being written... ($([math]::Round($stableChecks/2))s)" -ForegroundColor DarkGray
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch {
|
|
||||||
$stableChecks++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# STEP 2: Try to acquire exclusive access with exponential backoff
|
|
||||||
$maxRetries = 10
|
|
||||||
$retryCount = 0
|
$retryCount = 0
|
||||||
$baseDelay = 500 # Start with 500ms
|
$baseDelay = 100 # Start with 100ms, doubles each retry (100, 200, 400, 800...)
|
||||||
|
|
||||||
while ($retryCount -lt $maxRetries) {
|
while ($retryCount -lt $maxRetries) {
|
||||||
$fileStream = $null
|
$fileStream = $null
|
||||||
|
|||||||
Reference in New Issue
Block a user