Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion build/egress/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@

set -euo pipefail

# Clean out tmp
# Preserve any recordings from the previous session before cleanup
if [ -d /home/egress/tmp ] && [ "$(ls -A /home/egress/tmp 2>/dev/null)" ]; then
mkdir -p /home/egress/recovered
cp -r /home/egress/tmp/. /home/egress/recovered/
fi
rm -rf /home/egress/tmp/*

# Adjust max open file
Expand Down
3 changes: 2 additions & 1 deletion pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,14 @@ func (s *Server) Run() error {
func (s *Server) Status() ([]byte, error) {
status := map[string]interface{}{
"CpuLoad": s.monitor.GetAvailableCPU(),
"NodeId": s.conf.NodeID,
}
s.GetStatus(status)
return json.Marshal(status)
}

func (s *Server) IsIdle() bool {
return s.activeRequests.Load() == 0
return s.activeRequests.Load() == 0 && !s.IsDisabled()
}

func (s *Server) IsDisabled() bool {
Expand Down