Skip to content

Commit c843a67

Browse files
claireguyotkostorr
authored andcommitted
[O2B-560] Empty time objects are handled correctly and pass -1 to Bookkeeping if empty.
1 parent d139de9 commit c843a67

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

  • core/integration/bookkeeping

core/integration/bookkeeping/api.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,24 @@ func (bk *BookkeepingWrapper) UpdateRun(runNumber int32, runResult string, timeO
9696
runquality = sw.TEST_RunQuality
9797
}
9898

99-
_, _, err := clientAPI.UpdateRun(runNumber, runquality, timeO2Start.UnixMilli(), timeO2End.UnixMilli(), timeTrgStart.UnixMilli(), timeTrgEnd.UnixMilli(), trgGlobal, trg, pdpConfig, pdpTopology, tfbMode /*, odcFullname, lhcPeriod */)
99+
timeO2S := timeO2Start.UnixMilli()
100+
if (timeO2Start == time.Time{} || timeO2S < 0) {
101+
timeO2S = -1
102+
}
103+
timeO2E := timeO2End.UnixMilli()
104+
if (timeO2End == time.Time{} || timeO2E < 0) {
105+
timeO2E = -1
106+
}
107+
timeTrgS := timeTrgStart.UnixMilli()
108+
if (timeTrgStart == time.Time{} || timeTrgS < 0) {
109+
timeTrgS = -1
110+
}
111+
timeTrgE := timeTrgEnd.UnixMilli()
112+
if (timeTrgEnd == time.Time{} || timeTrgE < 0) {
113+
timeTrgE = -1
114+
}
115+
116+
_, _, err := clientAPI.UpdateRun(runNumber, runquality, timeO2S, timeO2E, timeTrgS, timeTrgE, trgGlobal, trg, pdpConfig, pdpTopology, tfbMode /*, odcFullname, lhcPeriod */)
100117
return err
101118
}
102119

0 commit comments

Comments
 (0)