Skip to content

Commit

Permalink
feat(runners): change log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Mar 27, 2024
1 parent c20a70e commit 7a1e080
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions services/runners/JobPool.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (p *JobPool) Run() {

if p.tryRegisterRunner() {

log.Info("Runner registered on server")
log.Info("The runner has been registered on the server")

break
}
Expand Down Expand Up @@ -319,7 +319,7 @@ func (p *JobPool) tryRegisterRunner() bool {
return true
}

log.Info("Trying to register on server")
log.Info("Attempting to register on the server")

if os.Getenv("SEMAPHORE_RUNNER_ID") != "" {

Expand Down Expand Up @@ -371,6 +371,8 @@ func (p *JobPool) tryRegisterRunner() bool {
panic("registration token cannot be empty")
}

log.Info("Registering a new runner")

client := &http.Client{}

url := util.Config.Runner.ApiURL + "/runners"
Expand Down Expand Up @@ -445,15 +447,15 @@ func (p *JobPool) checkNewJobs() {
}

if resp.StatusCode >= 400 {
log.Error("Checking new jobs error, server returns code ", resp.StatusCode)
log.Error("Encountered error while checking for new jobs; server returned code ", resp.StatusCode)
return
}

defer resp.Body.Close()

body, err := io.ReadAll(resp.Body)
if err != nil {
log.Error("Checking new jobs, error reading response body:", err)
log.Error("Encountered error while checking for new jobs; unable to read response body:", err)
return
}

Expand Down

0 comments on commit 7a1e080

Please sign in to comment.