GoAdminGroup / go-admin

A golang framework helps gopher to build a data visualization and admin panel in ten minutes
https://www.go-admin.com
Apache License 2.0
8.12k stars 1.32k forks source link

[BUG] No changes occur when changing config.Config. FileUploadEngine #622

Open Todvaa opened 4 months ago

Todvaa commented 4 months ago

I already solve the problem, but I spent time searching.

At the low level of the library, config values ​​are added to the database, but only if such a field does not already exist. Because of this, if you have ever run the config, no changes will occur.

Solution: Clear the goadmin_site table before starting.

Hope it will help to someone.

notcgi commented 4 months ago

Why do we need to store this config in DB? What is stored in DB? Full config? What will happened when we change the config of FileUploadEngine? Will it updated in db?

It should be described in doc

alikhanich commented 1 month ago

Well, this bug exists for all config options. For example language is not changed, when I change in config.yaml. In all examples configs are first loaded from config.yaml, then after the call to func (t SiteModel) Init(cfg map[string]string) SiteModel configs are loaded from database.