Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(743)

Unified Diff: cmd/jujud/unit.go

Issue 6767053: cmd/jujud: agent should perform one cycle (Closed)
Patch Set: cmd/jujud: agent should perform one cycle Created 12 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cmd/jujud/machine.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cmd/jujud/unit.go
=== modified file 'cmd/jujud/unit.go'
--- cmd/jujud/unit.go 2012-10-11 13:32:58 +0000
+++ cmd/jujud/unit.go 2012-10-25 10:24:27 +0000
@@ -50,7 +50,8 @@
func (a *UnitAgent) Run(ctx *cmd.Context) error {
defer log.Printf("uniter: unit agent exiting")
defer a.tomb.Done()
- for a.tomb.Err() == tomb.ErrStillAlive {
+Loop:
+ for {
err := a.runOnce()
if ug, ok := err.(*UpgradeReadyError); ok {
if err = ug.ChangeAgentTools(); err == nil {
@@ -70,6 +71,7 @@
select {
case <-a.tomb.Dying():
a.tomb.Kill(err)
+ break Loop
case <-time.After(retryDelay):
log.Printf("uniter: rerunning uniter")
}
« no previous file with comments | « cmd/jujud/machine.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b