mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 15:29:28 +01:00
fix(websocket): duplication logs for admin
This commit is contained in:
parent
5c50732914
commit
205fe71bcb
@ -261,14 +261,15 @@ func (t *TaskRunner) populateDetails() error {
|
||||
t.alertChat = project.AlertChat
|
||||
|
||||
// get project users
|
||||
users, err := t.pool.store.GetProjectUsers(t.Template.ProjectID, db.RetrieveQueryParams{})
|
||||
projectUsers, err := t.pool.store.GetProjectUsers(t.Template.ProjectID, db.RetrieveQueryParams{})
|
||||
if err != nil {
|
||||
return t.prepareError(err, "Users not found!")
|
||||
}
|
||||
|
||||
t.users = []int{}
|
||||
for _, user := range users {
|
||||
t.users = append(t.users, user.ID)
|
||||
users := make(map[int]bool)
|
||||
|
||||
for _, user := range projectUsers {
|
||||
users[user.ID] = true
|
||||
}
|
||||
|
||||
admins, err := t.pool.store.GetAllAdmins()
|
||||
@ -276,8 +277,13 @@ func (t *TaskRunner) populateDetails() error {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, user := range admins {
|
||||
t.users = append(t.users, user.ID)
|
||||
for _, admin := range admins {
|
||||
users[admin.ID] = true
|
||||
}
|
||||
|
||||
t.users = []int{}
|
||||
for userID := range users {
|
||||
t.users = append(t.users, userID)
|
||||
}
|
||||
|
||||
// get inventory
|
||||
|
Loading…
Reference in New Issue
Block a user