Skip to content

Commit

Permalink
Fix domain init
Browse files Browse the repository at this point in the history
  • Loading branch information
akclace committed Nov 17, 2024
1 parent 49f36eb commit 22d80ce
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/server/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (a *AppStore) GetAppInfo() ([]types.AppInfo, map[string]bool, error) {
a.mu.Lock()
defer a.mu.Unlock()

err := a.updateAppInfo(a.allApps)
err := a.updateAppInfo()
if err != nil {
return nil, nil, err
}
Expand All @@ -63,7 +63,7 @@ func (a *AppStore) GetAllApps() ([]types.AppInfo, error) {
a.mu.Lock()
defer a.mu.Unlock()

err := a.updateAppInfo(a.allApps)
err := a.updateAppInfo()
if err != nil {
return nil, err
}
Expand All @@ -82,14 +82,14 @@ func (a *AppStore) GetAllDomains() (map[string]bool, error) {
a.mu.Lock()
defer a.mu.Unlock()

err := a.updateAppInfo(a.allApps)
err := a.updateAppInfo()
if err != nil {
return nil, err
}
return a.allDomains, nil
}

func (a *AppStore) updateAppInfo(allApps []types.AppInfo) error {
func (a *AppStore) updateAppInfo() error {
var err error
a.allApps, err = a.server.db.GetAllApps(true)
if err != nil {
Expand All @@ -98,7 +98,7 @@ func (a *AppStore) updateAppInfo(allApps []types.AppInfo) error {

a.allDomains = make(map[string]bool)
a.allDomains[a.server.config.System.DefaultDomain] = true
for _, appInfo := range allApps {
for _, appInfo := range a.allApps {
if appInfo.Domain != "" {
a.allDomains[appInfo.Domain] = true
}
Expand Down

0 comments on commit 22d80ce

Please sign in to comment.