mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-03-16 17:54:07 +01:00
Fix agent polling (#3378)
This commit is contained in:
@@ -137,6 +137,9 @@ func PatchAgent(c *gin.Context) {
|
||||
}
|
||||
agent.Name = in.Name
|
||||
agent.NoSchedule = in.NoSchedule
|
||||
if agent.NoSchedule {
|
||||
server.Config.Services.Queue.KickAgentWorkers(agent.ID)
|
||||
}
|
||||
|
||||
err = _store.AgentUpdate(agent)
|
||||
if err != nil {
|
||||
@@ -214,6 +217,9 @@ func DeleteAgent(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// kick workers to remove the agent from the queue
|
||||
server.Config.Services.Queue.KickAgentWorkers(agent.ID)
|
||||
|
||||
if err = _store.AgentDelete(agent); err != nil {
|
||||
c.String(http.StatusInternalServerError, "Error deleting user. %s", err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user