diff --git a/app/agent.go b/app/agent.go index 3803d611..c88831d0 100644 --- a/app/agent.go +++ b/app/agent.go @@ -38,7 +38,7 @@ func (app *App) SetAgentOnline(agentId int, onDemand bool) (*model.AgentOnlineDa if err != nil { return nil, err } - app.Queue().Manager().AgentTeamHook(model.HookAgentStatus, agentObj) + app.Queue().Manager().AgentTeamHook(model.HookAgentStatus, agentObj, agent.TeamUpdatedAt) return data, nil } } @@ -67,7 +67,7 @@ func (app *App) SetAgentLogout(agentId int) *model.AppError { if err != nil { return err } - app.Queue().Manager().AgentTeamHook(model.HookAgentStatus, agentObj) + app.Queue().Manager().AgentTeamHook(model.HookAgentStatus, agentObj, agent.TeamUpdatedAt) return nil } } @@ -106,7 +106,7 @@ func (app *App) SetAgentPause(agentId int, payload *string, timeout *int) *model if err != nil { return err } - app.Queue().Manager().AgentTeamHook(model.HookAgentStatus, agentObj) + app.Queue().Manager().AgentTeamHook(model.HookAgentStatus, agentObj, agent.TeamUpdatedAt) return nil } } @@ -116,7 +116,7 @@ func (app *App) SetAgentBreakOut(agent agent_manager.AgentObject) *model.AppErro if err != nil { return err } - app.Queue().Manager().AgentTeamHook(model.HookAgentStatus, agent) + app.Queue().Manager().AgentTeamHook(model.HookAgentStatus, agent, agent.TeamUpdatedAt()) return nil } diff --git a/queue/queue_manager.go b/queue/queue_manager.go index 3162475a..c111cb7d 100644 --- a/queue/queue_manager.go +++ b/queue/queue_manager.go @@ -1238,8 +1238,8 @@ func (queueManager *QueueManager) FlipAttemptResource(attempt *Attempt, skipp [] return res, nil } -func (queueManager *QueueManager) AgentTeamHook(event string, agent agent_manager.AgentObject) { - queueManager.teamManager.HookAgent(event, agent) +func (queueManager *QueueManager) AgentTeamHook(event string, agent agent_manager.AgentObject, teamUpdatedAt int64) { + queueManager.teamManager.HookAgent(event, agent, teamUpdatedAt) } // waitTimeout waits for the waitgroup for the specified max timeout. diff --git a/queue/team.go b/queue/team.go index 52150455..13552c36 100644 --- a/queue/team.go +++ b/queue/team.go @@ -126,8 +126,8 @@ func (tm *teamManager) GetTeam(id int, updatedAt int64) (*agentTeam, *model.AppE return team, nil } -func (tm *teamManager) HookAgent(event string, agent agent_manager.AgentObject) *model.AppError { - team, err := tm.GetTeam(agent.TeamId(), agent.TeamUpdatedAt()) +func (tm *teamManager) HookAgent(event string, agent agent_manager.AgentObject, teamUpdatedAt int64) *model.AppError { + team, err := tm.GetTeam(agent.TeamId(), teamUpdatedAt) if err != nil { return err }