Add and update netquery code based on review discussions

This commit is contained in:
Patrick Pacher
2022-03-17 14:28:01 +01:00
parent 976c0a702e
commit c2d2064ec8
9 changed files with 324 additions and 148 deletions

View File

@@ -12,7 +12,7 @@ import (
const (
cleanerTickDuration = 5 * time.Second
deleteConnsAfterEndedThreshold = 10 * time.Minute
DeleteConnsAfterEndedThreshold = 10 * time.Minute
)
func connectionCleaner(ctx context.Context) error {
@@ -41,7 +41,7 @@ func cleanConnections() (activePIDs map[int]struct{}) {
_ = module.RunMediumPriorityMicroTask(&name, func(ctx context.Context) error {
now := time.Now().UTC()
nowUnix := now.Unix()
deleteOlderThan := now.Add(-deleteConnsAfterEndedThreshold).Unix()
deleteOlderThan := now.Add(-DeleteConnsAfterEndedThreshold).Unix()
// network connections
for _, conn := range conns.clone() {