Skip to content

Commit

Permalink
update policy read to internal path.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k1o committed Jul 25, 2021
1 parent a37c0ec commit 77e204f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/room/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,10 @@ func (manager *RoomManagerCtx) GetSettings(id string) (*types.RoomSettings, erro
}

// TODO: Refactor.
if policyMount != nil {
if _, err := os.Stat(policyMount.HostPath); !os.IsNotExist(err) {
if data, err := os.ReadFile(policyMount.HostPath); err == nil {
if policyMount != nil && policyMount.Type == types.MountTemplate {
templateInternalPath := path.Join(manager.config.StorageInternal, templateStoragePath, policyMount.HostPath)
if _, err := os.Stat(templateInternalPath); !os.IsNotExist(err) {
if data, err := os.ReadFile(templateInternalPath); err == nil {
if pData, err := policies.Parse(string(data), policyConfig.Type); err == nil {
policiesData = pData
}
Expand Down

0 comments on commit 77e204f

Please sign in to comment.