Fix sending status event to all subscribers, send disk usage when server is offline

This commit is contained in:
Matthew Penner
2020-05-22 11:01:27 -06:00
parent bd063682dc
commit 74097cc4ad
2 changed files with 34 additions and 4 deletions

View File

@@ -247,6 +247,10 @@ func FromConfiguration(data *api.ServerConfigurationResponse) (*Server, error) {
}
s.Resources = ResourceUsage{}
// Force the disk usage to become cached to return in a resources response
// or when connecting to the websocket of an offline server.
go s.Filesystem.HasSpaceAvailable()
// Forces the configuration to be synced with the panel.
if err := s.SyncWithConfiguration(data); err != nil {
return nil, err