Skip to content

Commit

Permalink
WTEL-4400
Browse files Browse the repository at this point in the history
  • Loading branch information
i.navrotskyj committed Apr 30, 2024
1 parent e519dcd commit d2a6f5c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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
}
}
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions queue/queue_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions queue/team.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d2a6f5c

Please sign in to comment.