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

Commit

Permalink
Submit on FM startup (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebarakos authored Mar 30, 2021
1 parent d839956 commit 36087f8
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 36087f8

Please sign in to comment.