Skip to content

Commit

Permalink
Use the old fetch call if daemon is not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisr-spectra committed Jun 13, 2024
1 parent 91c41e5 commit e29ef8f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rrd_c.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,12 @@ func Fetch(filename, cf string, start, end time.Time, step time.Duration, daemon
cDsNames **C.char
cData *C.double
)
err := makeError(C.rrdDaemonFetch(&ret, cDaemon, fn, cCf, &cStart, &cEnd, &cStep, &cDsCnt, &cDsNames, &cData))
var err error
if daemon != nil {
err = makeError(C.rrdDaemonFetch(&ret, cDaemon, fn, cCf, &cStart, &cEnd, &cStep, &cDsCnt, &cDsNames, &cData))
} else {
err = makeError(C.rrdFetch(&ret, fn, cCf, &cStart, &cEnd, &cStep, &cDsCnt, &cDsNames, &cData))
}
if err != nil {
return FetchResult{filename, cf, start, end, step, nil, 0, nil}, err
}
Expand Down

0 comments on commit e29ef8f

Please sign in to comment.