Skip to content

Commit 0a171be

Browse files
committed
HMS-10740: rename function and variable to reflect meaning
1 parent ab3891b commit 0a171be

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

manager/controllers/template_subscribed_systems_update.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ func TemplateSubscribedSystemsUpdateHandler(c *gin.Context) {
5858

5959
// re-evaluate systems added/removed from templates
6060
if config.EnableTemplateChangeEval {
61-
inventoryAIDs := kafka.InventoryIDs2InventoryAIDs(account, orgID, systemList)
62-
kafka.RecalcSystems(inventoryAIDs)
61+
evalDataList := kafka.InventoryIDs2EvalData(account, orgID, systemList)
62+
kafka.RecalcSystems(evalDataList)
6363
}
6464
c.Status(http.StatusOK)
6565
}

manager/controllers/template_systems_delete.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ func TemplateSystemsDeleteHandler(c *gin.Context) {
5757

5858
// re-evaluate systems removed from templates
5959
if config.EnableTemplateChangeEval {
60-
inventoryAIDs := kafka.InventoryIDs2InventoryAIDs(account, orgID, req.Systems)
61-
kafka.RecalcSystems(inventoryAIDs)
60+
evalDataList := kafka.InventoryIDs2EvalData(account, orgID, req.Systems)
61+
kafka.RecalcSystems(evalDataList)
6262
}
6363
c.Status(http.StatusOK)
6464
}

manager/controllers/template_systems_update.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ func TemplateSystemsUpdateHandler(c *gin.Context) {
9191

9292
// re-evaluate systems added/removed from templates
9393
if config.EnableTemplateChangeEval {
94-
inventoryAIDs := kafka.InventoryIDs2InventoryAIDs(account, orgID, req.Systems)
95-
kafka.RecalcSystems(inventoryAIDs)
94+
evalDataList := kafka.InventoryIDs2EvalData(account, orgID, req.Systems)
95+
kafka.RecalcSystems(evalDataList)
9696
}
9797
c.Status(http.StatusOK)
9898
}

manager/kafka/kafka.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ func runRecalcLoop() {
2929
}
3030
}
3131

32-
func InventoryIDs2InventoryAIDs(accountID int, orgID string, inventoryIDs []string) []mqueue.EvalData {
33-
inventoryAIDs := make([]mqueue.EvalData, 0, len(inventoryIDs))
32+
func InventoryIDs2EvalData(accountID int, orgID string, inventoryIDs []string) []mqueue.EvalData {
33+
evalDataList := make([]mqueue.EvalData, 0, len(inventoryIDs))
3434
for _, v := range inventoryIDs {
35-
inventoryAIDs = append(inventoryAIDs, mqueue.EvalData{InventoryID: v, RhAccountID: accountID, OrgID: &orgID})
35+
evalDataList = append(evalDataList, mqueue.EvalData{InventoryID: v, RhAccountID: accountID, OrgID: &orgID})
3636
}
37-
return inventoryAIDs
37+
return evalDataList
3838
}
3939

4040
func sendInventoryIDs(inventoryIDs mqueue.EvalDataSlice) {

manager/kafka/kafka_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ func testRecalcSystems(t *testing.T, accountID int, orgID string, inventoryIDs [
1818

1919
writerMock := mqueue.MockKafkaWriter{}
2020
TryStartEvalQueue(mqueue.MockCreateKafkaWriter(&writerMock))
21-
inventoryAIDs := InventoryIDs2InventoryAIDs(accountID, orgID, inventoryIDs)
22-
RecalcSystems(inventoryAIDs)
21+
evaldataList := InventoryIDs2EvalData(accountID, orgID, inventoryIDs)
22+
RecalcSystems(evaldataList)
2323
utils.AssertEqualWait(t, 1, func() (exp, act interface{}) {
2424
return 1, len(writerMock.Messages)
2525
})

0 commit comments

Comments
 (0)