summaryrefslogtreecommitdiff
path: root/internal/server/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/server/server.go')
-rw-r--r--internal/server/server.go20
1 files changed, 1 insertions, 19 deletions
diff --git a/internal/server/server.go b/internal/server/server.go
index 31fa85d..d8d43c9 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -7,7 +7,6 @@ import (
"io"
"net"
"strings"
- "time"
"github.com/mimecast/dtail/internal/config"
"github.com/mimecast/dtail/internal/io/logger"
@@ -33,9 +32,6 @@ type Server struct {
sched *scheduler
// Mointor log files for pattern (if configured)
cont *continuous
- // Wait counter, e.g. there might be still subprocesses (forked by drun) to be killed.
- // TODO: Remove this counter.
- shutdownWaitFor chan struct{}
}
// New returns a new server.
@@ -46,7 +42,6 @@ func New() *Server {
sshServerConfig: &gossh.ServerConfig{},
catLimiter: make(chan struct{}, config.Server.MaxConcurrentCats),
tailLimiter: make(chan struct{}, config.Server.MaxConcurrentTails),
- shutdownWaitFor: make(chan struct{}, 1000),
sched: newScheduler(),
cont: newContinuous(),
}
@@ -82,25 +77,12 @@ func (s *Server) Start(ctx context.Context) int {
select {
case <-ctx.Done():
- // Wait until all commands/jobs/children are no more!
- s.wait()
}
// For future use.
return 0
}
-func (s *Server) wait() {
- for {
- num := len(s.shutdownWaitFor)
- logger.Debug("Waiting for stuff to finish", num)
- if num <= 0 {
- return
- }
- time.Sleep(time.Second)
- }
-}
-
func (s *Server) listenerLoop(ctx context.Context, listener net.Listener) {
logger.Debug("Starting listener loop")
@@ -180,7 +162,7 @@ func (s *Server) handleRequests(ctx context.Context, sshConn gossh.Conn, in <-ch
case config.ControlUser:
handler = handlers.NewControlHandler(user)
default:
- handler = handlers.NewServerHandler(user, s.catLimiter, s.tailLimiter, s.shutdownWaitFor)
+ handler = handlers.NewServerHandler(user, s.catLimiter, s.tailLimiter)
}
terminate := func() {