Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Submit on FM startup #119

Merged
merged 3 commits into from
Mar 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions services/fluxmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ func NewFluxMonitor(config FluxMonitorConfig, triggerJobRun chan subscriber.Even
}

fm.canSubmitUpdated()

// make an initial sumbission on startup
fm.checkAndSendJob(false)
go fm.eventListener(FAEvents)

return &fm, nil
Expand Down Expand Up @@ -214,7 +215,7 @@ func (fm *FluxMonitor) checkAndSendJob(initiate bool) error {
return err
}

// If latestResult is an old value for some reason, try to fetch new
// If latestResult is an old value or have not been set yet, try to fetch new
if time.Since(fm.latestResultTimestamp) > fm.config.PollInterval+fm.config.AdapterTimeout {
logger.Warn("Polling again because result is old")
err := fm.poll()
Expand Down