File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
client/internal/updatemanager Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -61,15 +61,20 @@ func (u *UpdateManager) SetVersion(v string) {
61
61
log .Tracef ("Auto-update version set to %s" , v )
62
62
u .version = v
63
63
u .mutex .Unlock ()
64
- go u .Updated ("N/A" )
64
+ go u .Updated (unknownVersion )
65
65
} else {
66
66
u .mutex .Unlock ()
67
67
}
68
68
}
69
69
70
70
func (u * UpdateManager ) Stop () {
71
- u .update .StopWatch ()
72
71
u .cancel ()
72
+ u .mutex .Lock ()
73
+ defer u .mutex .Unlock ()
74
+ if u .update != nil {
75
+ u .update .StopWatch ()
76
+ u .update = nil
77
+ }
73
78
u .waitGroup .Wait ()
74
79
}
75
80
@@ -78,12 +83,7 @@ func (u *UpdateManager) Updated(latestVersion string) {
78
83
defer u .waitGroup .Done ()
79
84
u .mutex .Lock ()
80
85
defer u .mutex .Unlock ()
81
- select {
82
- case <- u .ctx .Done ():
83
- return
84
- default :
85
- }
86
- if latestVersion != "N/A" {
86
+ if latestVersion != unknownVersion {
87
87
u .latestVersion = latestVersion
88
88
}
89
89
ctx , cancel := context .WithDeadline (u .ctx , time .Now ().Add (time .Minute ))
You can’t perform that action at this time.
0 commit comments