Skip to content

Commit

Permalink
[core] Ensure correct JSON output for odc.GetEnvironmentData
Browse files Browse the repository at this point in the history
  • Loading branch information
teo committed Jul 4, 2023
1 parent 3ac1303 commit 465937c
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions core/integration/odc/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (

"github.com/AliceO2Group/Control/apricot"
"github.com/AliceO2Group/Control/common/logger/infologger"
"github.com/AliceO2Group/Control/common/utils"
"github.com/AliceO2Group/Control/common/utils/uid"
"github.com/AliceO2Group/Control/core/integration"
odc "github.com/AliceO2Group/Control/core/integration/odc/protos"
Expand Down Expand Up @@ -81,21 +82,21 @@ type OdcStatus struct {
}

type OdcPartitionInfo struct {
PartitionId uid.ID
RunNumber uint32
State string
DdsSessionId string
DdsSessionStatus string
Devices []OdcDevice
Hosts []string
PartitionId uid.ID `json:"-"`
RunNumber uint32 `json:"runNumber"`
State string `json:"state"`
DdsSessionId string `json:"ddsSessionId"`
DdsSessionStatus string `json:"ddsSessionStatus"`
Devices []OdcDevice `json:"devices"`
Hosts []string `json:"hosts"`
}

type OdcDevice struct {
TaskId uint64
State string
Path string
Ignored bool
Host string
TaskId uint64 `json:"taskId"`
State string `json:"state"`
Path string `json:"path"`
Ignored bool `json:"ignored"`
Host string `json:"host"`
}

func NewPlugin(endpoint string) integration.Plugin {
Expand Down Expand Up @@ -136,6 +137,7 @@ func (p *Plugin) GetConnectionState() string {
}

func (p *Plugin) queryPartitionStatus() {
defer utils.TimeTrackFunction(time.Now(), log.WithPrefix("odcclient"))
ctx, cancel := context.WithTimeout(context.Background(), ODC_STATUS_TIMEOUT)
defer cancel()

Expand Down

0 comments on commit 465937c

Please sign in to comment.