Skip to content

Commit

Permalink
Merge pull request #54 from webitel/v24.02
Browse files Browse the repository at this point in the history
DEV-3973
  • Loading branch information
navrotskyj authored Mar 26, 2024
2 parents bb09f85 + 2f498db commit 75e5636
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions queue/dialing.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ func (d *DialingImpl) routeIdleAgents() {
} else {
d.queueManager.TimeoutLeavingMember(a)
}
} else {
// TODO
d.queueManager.store.Member().SetTimeoutError(v.AttemptId)
wlog.Error("attempt[%d] error: not found in cache, set timeout error")
}
}
} else {
Expand Down
16 changes: 16 additions & 0 deletions store/sqlstore/member_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,22 @@ where a.timeout < now() and a.node_id = :NodeId and not a.schema_processing is t
return attempts, nil
}

func (s *SqlMemberStore) SetTimeoutError(id int64) *model.AppError {
_, err := s.GetMaster().Exec(`update call_center.cc_member_attempt
set schema_processing = false,
result = 'timeout error'
where id = :Id;`, map[string]interface{}{
"Id": id,
})

if err != nil {
return model.NewAppError("SqlMemberStore.SetTimeoutError", "store.sql_member.set_timeouts.app_error", nil,
err.Error(), http.StatusInternalServerError)
}

return nil
}

func (s *SqlMemberStore) CallbackReporting(attemptId int64, callback *model.AttemptCallback, maxAttempts uint, waitBetween uint64, perNum bool) (*model.AttemptReportingResult, *model.AppError) {
var result *model.AttemptReportingResult
err := s.GetMaster().SelectOne(&result, `select *
Expand Down
1 change: 1 addition & 0 deletions store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ type MemberStore interface {

SaveToHistory() ([]*model.HistoryAttempt, *model.AppError)
GetTimeouts(nodeId string) ([]*model.AttemptReportingTimeout, *model.AppError)
SetTimeoutError(id int64) *model.AppError
RenewalProcessing(domainId, attId int64, renewalSec uint32) (*model.RenewalProcessing, *model.AppError)

// CHAT TODO
Expand Down

0 comments on commit 75e5636

Please sign in to comment.