Skip to content

Commit fd70dac

Browse files
committed
minor validation fixes
1 parent 2681711 commit fd70dac

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

utils/admin/validate.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ func (v *validator) startValidation(id, account, key string, mode int) error {
3737
go func() {
3838
timer := time.Now()
3939
for {
40-
if !v.isActive() {
41-
return
42-
}
43-
4440
if err := v.routineRead(); err != nil {
4541
log.Println("Validate: Error -", err)
4642
}
4743

44+
if !v.isActive() {
45+
return
46+
}
47+
4848
// Sleep for 5 minutes before connecting again
4949
time.Sleep(5 * time.Minute)
5050

@@ -70,6 +70,9 @@ func (v *validator) startValidation(id, account, key string, mode int) error {
7070
func (v *validator) stopValidation() {
7171
v.lock.Lock()
7272
v.active = false
73+
if v.socket != nil {
74+
v.socket.Close()
75+
}
7376
v.lock.Unlock()
7477
}
7578

0 commit comments

Comments
 (0)