Fix the race condition where the race is actually happening
This commit is contained in:
parent
0fc1f300f8
commit
b9fb922e91
|
@ -16,7 +16,9 @@ import (
|
||||||
func getServer(c *gin.Context) {
|
func getServer(c *gin.Context) {
|
||||||
s := GetServer(c.Param("server"))
|
s := GetServer(c.Param("server"))
|
||||||
|
|
||||||
c.JSON(http.StatusOK, s.Proc())
|
p := *s.Proc()
|
||||||
|
|
||||||
|
c.JSON(http.StatusOK, p)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the logs for a given server instance.
|
// Returns the logs for a given server instance.
|
||||||
|
|
|
@ -50,7 +50,7 @@ func (s *Server) StartEventListeners() {
|
||||||
// cause it to block until the first call is done calculating disk usage, which will
|
// cause it to block until the first call is done calculating disk usage, which will
|
||||||
// case stat events to pile up for the server.
|
// case stat events to pile up for the server.
|
||||||
s.Filesystem.HasSpaceAvailable()
|
s.Filesystem.HasSpaceAvailable()
|
||||||
|
|
||||||
s.emitProcUsage()
|
s.emitProcUsage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user