fix: avoid main call timeout dependency
This commit is contained in:
@@ -2791,11 +2791,7 @@ func (a *adapter) TenantCallList(id t.TenantID, uid t.Uid, topic, cursor string,
|
|||||||
|
|
||||||
func (a *adapter) finalizeStaleCalls(ctx context.Context) error {
|
func (a *adapter) finalizeStaleCalls(ctx context.Context) error {
|
||||||
now := t.TimeNow()
|
now := t.TimeNow()
|
||||||
startedTimeout := imCallTimeoutSeconds()
|
startedBefore := now.Add(-30 * time.Second)
|
||||||
if startedTimeout <= 0 {
|
|
||||||
startedTimeout = defaultCallEstablishmentTimeout
|
|
||||||
}
|
|
||||||
startedBefore := now.Add(-time.Duration(startedTimeout) * time.Second)
|
|
||||||
acceptedBefore := now.Add(-12 * time.Hour)
|
acceptedBefore := now.Add(-12 * time.Hour)
|
||||||
if _, err := a.db.ExecContext(ctx, `UPDATE im_call_records
|
if _, err := a.db.ExecContext(ctx, `UPDATE im_call_records
|
||||||
SET status=?,end_reason=?,duration_ms=0,finished_at=?,updated_at=?
|
SET status=?,end_reason=?,duration_ms=0,finished_at=?,updated_at=?
|
||||||
|
|||||||
Reference in New Issue
Block a user