File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const (
14
14
// ZOMBIE_TIMEOUT - timeout in hours for checking zombie status
15
15
ZOMBIE_TIMEOUT = 6
16
16
// ZOMBIE_DELETE_TIME - timeout in minutes for zombie node deletion
17
- ZOMBIE_DELETE_TIME = 120
17
+ ZOMBIE_DELETE_TIME = 10
18
18
)
19
19
20
20
var (
@@ -139,7 +139,10 @@ func ManageZombies(ctx context.Context, peerUpdate chan *models.Node) {
139
139
if servercfg .IsAutoCleanUpEnabled () {
140
140
nodes , _ := GetAllNodes ()
141
141
for _ , node := range nodes {
142
- if time .Since (node .LastCheckIn ) > time .Minute * ZOMBIE_DELETE_TIME {
142
+ if ! node .Connected {
143
+ continue
144
+ }
145
+ if time .Since (node .LastCheckIn ) > time .Hour * 2 {
143
146
if err := DeleteNode (& node , true ); err != nil {
144
147
continue
145
148
}
@@ -168,8 +171,8 @@ func checkPendingRemovalNodes(peerUpdate chan *models.Node) {
168
171
peerUpdate <- & node
169
172
continue
170
173
}
171
- if servercfg .IsAutoCleanUpEnabled () {
172
- if time .Since (node .LastCheckIn ) > time .Minute * ZOMBIE_DELETE_TIME {
174
+ if servercfg .IsAutoCleanUpEnabled () && node . Connected {
175
+ if time .Since (node .LastCheckIn ) > time .Hour * 2 {
173
176
if err := DeleteNode (& node , true ); err != nil {
174
177
continue
175
178
}
You can’t perform that action at this time.
0 commit comments