mirror of
https://github.com/kemko/nomad.git
synced 2026-01-10 12:25:42 +03:00
better comments and remove commented code
This commit is contained in:
@@ -406,6 +406,10 @@ FAIL:
|
||||
if !next.Equal(currentDeadline) {
|
||||
prevDeadlineZero := currentDeadline.IsZero()
|
||||
currentDeadline = next
|
||||
// The most recent deadline can be zero if no allocs were created for this deployment.
|
||||
// The deadline timer would have already been stopped once in that case. To prevent
|
||||
// deadlocking on the already stopped deadline timer, we only drain the channel if
|
||||
// the previous deadline was not zero.
|
||||
if !prevDeadlineZero && !deadlineTimer.Stop() {
|
||||
<-deadlineTimer.C
|
||||
}
|
||||
|
||||
@@ -899,10 +899,7 @@ func TestDeploymentWatcher_Watch_StartWithoutProgressDeadline(t *testing.T) {
|
||||
a := mock.Alloc()
|
||||
a.CreateTime = time.Now().UnixNano()
|
||||
a.DeploymentID = d.ID
|
||||
/*a.DeploymentStatus = &structs.AllocDeploymentStatus{
|
||||
Healthy: helper.BoolToPtr(false),
|
||||
Timestamp: time.Now(),
|
||||
}*/
|
||||
|
||||
assert.Nil(m.state.UpsertAllocs(m.nextIndex(), []*structs.Allocation{a}), "UpsertAllocs")
|
||||
|
||||
d.TaskGroups["web"].ProgressDeadline = 500 * time.Millisecond
|
||||
|
||||
Reference in New Issue
Block a user