feat(feishu): 添加飞书入站事件inbox和混合数据库协调功能 - 实现飞书入站事件持久化inbox机制,支持状态管理、租约锁定和重试退避 - 添加混合数据库基线协调工具,确保平台PostgreSQL结构安全对齐 - 增加运行组件心跳检测和readiness就绪检查机制 - 实现app_ticket事件的安全轮换和验证处理 - 添加生产环境运行编排和fail-closed安全机制 - 支持webhook快速确认和长连接独立进程处理 - 完善个人数据擦除时的待处理事件清理功能 ```
45 lines
1.3 KiB
PowerShell
45 lines
1.3 KiB
PowerShell
$ErrorActionPreference = "Stop"
|
|
$projectRoot = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
|
|
$runtimeRoot = Join-Path $projectRoot ".runtime"
|
|
|
|
function Stop-OwnedRuntimeProcess {
|
|
param(
|
|
[string]$Name,
|
|
[string]$PidFile
|
|
)
|
|
|
|
if (-not (Test-Path -LiteralPath $PidFile)) {
|
|
Write-Host "$Name is not running."
|
|
return
|
|
}
|
|
$parts = (Get-Content -LiteralPath $PidFile -Raw).Trim().Split("|")
|
|
$processId = 0
|
|
$startTicks = 0L
|
|
$validIdentity = (
|
|
$parts.Count -eq 2 -and
|
|
[int]::TryParse($parts[0], [ref]$processId) -and
|
|
[long]::TryParse($parts[1], [ref]$startTicks)
|
|
)
|
|
$process = $null
|
|
if ($validIdentity) {
|
|
$process = Get-Process -Id $processId -ErrorAction SilentlyContinue
|
|
}
|
|
if (
|
|
$null -ne $process -and
|
|
$process.StartTime.ToUniversalTime().Ticks -eq $startTicks
|
|
) {
|
|
Stop-Process -Id $processId -Force
|
|
Write-Host "Stopped $Name (PID $processId)."
|
|
} else {
|
|
Write-Host "$Name had no matching live process; removed its stale PID file."
|
|
}
|
|
Remove-Item -LiteralPath $PidFile -Force
|
|
}
|
|
|
|
Stop-OwnedRuntimeProcess `
|
|
-Name "Feishu events" `
|
|
-PidFile (Join-Path $runtimeRoot "feishu-events.pid")
|
|
Stop-OwnedRuntimeProcess `
|
|
-Name "API and embedded scheduler" `
|
|
-PidFile (Join-Path $runtimeRoot "api.pid")
|