feat: Preload Locations and Certificate for proxy hosts in ApplyConfig

This commit is contained in:
Wikid82
2025-11-24 02:32:52 +00:00
parent 65ce88d59c
commit 247c7d1d7b
+1 -1
View File
@@ -37,7 +37,7 @@ func NewManager(client *Client, db *gorm.DB, configDir string, frontendDir strin
func (m *Manager) ApplyConfig(ctx context.Context) error {
// Fetch all proxy hosts from database
var hosts []models.ProxyHost
if err := m.db.Find(&hosts).Error; err != nil {
if err := m.db.Preload("Locations").Preload("Certificate").Find(&hosts).Error; err != nil {
return fmt.Errorf("fetch proxy hosts: %w", err)
}