~pedronis/ubuntu-push/acceptanceclient-send-build-num

« back to all changes in this revision

Viewing changes to poller/poller.go

  • Committer: Tarmac
  • Author(s): Bret Barker
  • Date: 2015-03-26 14:04:00 UTC
  • mfrom: (385.1.2 more-sleep-logging)
  • Revision ID: tarmac-20150326140400-rpnuuuwk74vz20uz
[r=pedronis] ref #1435109 - remove SessionStateSettle sleep on wake, + more debug logging

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
                p.log.Errorf("RequestWakelock got %v", err)
178
178
                return lockCookie
179
179
        }
180
 
        p.log.Debugf("got wakelock cookie of %s", lockCookie)
181
 
        time.Sleep(p.times.SessionStateSettle)
 
180
        p.log.Debugf("got wakelock cookie of %s, checking conn state", lockCookie)
 
181
        // XXX killed as part of bug #1435109 troubleshooting, remove cfg if remains unused
 
182
        // time.Sleep(p.times.SessionStateSettle)
182
183
        for i := 0; i < 20; i++ {
183
184
                if p.IsConnected() {
 
185
                        p.log.Debugf("iter %02d: connected", i)
184
186
                        break
185
187
                }
 
188
                p.log.Debugf("iter %02d: not connected, sleeping for %s", i, p.times.NetworkWait/20)
186
189
                time.Sleep(p.times.NetworkWait / 20)
 
190
                p.log.Debugf("iter %02d: slept", i)
187
191
        }
188
192
        if !p.IsConnected() {
189
193
                p.log.Errorf("not connected after %s; giving up", p.times.NetworkWait)
215
219
                }
216
220
 
217
221
                // XXX check whether something was actually done before waiting
 
222
                p.log.Debugf("sleeping for DoneWait %s", p.times.DoneWait)
218
223
                time.Sleep(p.times.DoneWait)
 
224
                p.log.Debugf("slept")
219
225
        }
220
226
 
221
227
        return lockCookie