Fix the race condition where the race is actually happening

This commit is contained in:
Dane Everitt 2020-08-18 21:46:17 -07:00
parent 0fc1f300f8
commit b9fb922e91
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
2 changed files with 4 additions and 2 deletions

View File

@ -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.

View File

@ -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()
} }
} }