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

Commit

Permalink
Bug 1588789 - log workerReady the first time we're ready to call queu…
Browse files Browse the repository at this point in the history
…e.claimWork
  • Loading branch information
petemoore committed Oct 15, 2019
1 parent 2e60675 commit c005a0c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ var (
reclaimEvery5Seconds = false
// Current working directory of process
cwd = CwdOrPanic()
// workerReady becomes true when it is able to call queue.claimWork for the first time
workerReady = false
// Whether we are running under the aws provisioner
configureForAWS bool
// Whether we are running in GCP
Expand Down Expand Up @@ -390,7 +392,6 @@ func RunWorker() (exitCode ExitCode) {
if host, err := sysinfo.Host(); err == nil {
logEvent("instanceBoot", nil, host.Info().BootTime)
}
logEvent("workerReady", nil, time.Now())

err = setupExposer()
if err != nil {
Expand Down Expand Up @@ -541,6 +542,11 @@ func RunWorker() (exitCode ExitCode) {

// ClaimWork queries the Queue to find a task.
func ClaimWork() *TaskRun {
// only log workerReady the first time queue.claimWork is called
if !workerReady {
workerReady = true
logEvent("workerReady", nil, time.Now())
}
req := &tcqueue.ClaimWorkRequest{
Tasks: 1,
WorkerGroup: config.WorkerGroup,
Expand Down

0 comments on commit c005a0c

Please sign in to comment.