fix: expire stale call pushes

This commit is contained in:
richjohnrambo
2026-09-14 12:11:43 +08:00
parent 4854e090ef
commit 789e662bdb
8 changed files with 164 additions and 14 deletions
+5 -1
View File
@@ -2791,7 +2791,11 @@ func (a *adapter) TenantCallList(id t.TenantID, uid t.Uid, topic, cursor string,
func (a *adapter) finalizeStaleCalls(ctx context.Context) error {
now := t.TimeNow()
startedBefore := now.Add(-2 * time.Minute)
startedTimeout := imCallTimeoutSeconds()
if startedTimeout <= 0 {
startedTimeout = defaultCallEstablishmentTimeout
}
startedBefore := now.Add(-time.Duration(startedTimeout) * time.Second)
acceptedBefore := now.Add(-12 * time.Hour)
if _, err := a.db.ExecContext(ctx, `UPDATE im_call_records
SET status=?,end_reason=?,duration_ms=0,finished_at=?,updated_at=?