added the database version number (will be important later) and revamped the About page a bit, to include the database version number

This commit is contained in:
2026-03-05 22:02:26 -07:00
parent f5360772ca
commit 5f67d8ce16
7 changed files with 49 additions and 37 deletions
+12 -8
View File
@@ -28,14 +28,18 @@ func SetupDb() (func(), error) {
db, err := sqlx.Connect(config.GlobalComputedConfig.DatabaseDriver, config.GlobalComputedConfig.DatabaseDSN)
if err == nil {
amdb = db
setupAdCache()
setupUserCache()
setupContactsCache()
setupCommunityCache()
setupServicesCache()
setupConferenceCache()
exitfns = append(exitfns, setupAuditWriter())
exitfns = append(exitfns, setupIPBanSweep())
g, err := AmGlobals(context.Background())
if err == nil {
setupAdCache()
setupUserCache()
setupContactsCache()
setupCommunityCache()
setupServicesCache()
setupConferenceCache()
exitfns = append(exitfns, setupAuditWriter())
exitfns = append(exitfns, setupIPBanSweep())
log.Infof("SetupDb(): database version %s", g.Version)
}
}
return func() {
slices.Reverse(exitfns)
+11 -8
View File
@@ -20,14 +20,15 @@ import (
// Globals contains the global data.
type Globals struct {
Mutex sync.Mutex
PostsPerPage int32 `db:"posts_per_page"`
OldPostsAtTop int32 `db:"old_posts_at_top"`
MaxSearchPage int32 `db:"max_search_page"`
MaxCommunityMemberPage int32 `db:"max_comm_mbr_page"`
MaxConferenceMemberPage int32 `db:"max_conf_mbr_page"`
FrontPagePosts int32 `db:"fp_posts"`
NumAuditPage int32 `db:"num_audit_page"`
CommunityCreateLevel int32 `db:"comm_create_lvl"`
Version string `db:"version"`
PostsPerPage int32 `db:"posts_per_page"`
OldPostsAtTop int32 `db:"old_posts_at_top"`
MaxSearchPage int32 `db:"max_search_page"`
MaxCommunityMemberPage int32 `db:"max_comm_mbr_page"`
MaxConferenceMemberPage int32 `db:"max_conf_mbr_page"`
FrontPagePosts int32 `db:"fp_posts"`
NumAuditPage int32 `db:"num_audit_page"`
CommunityCreateLevel int32 `db:"comm_create_lvl"`
flags *util.OptionSet
}
@@ -63,6 +64,7 @@ var globalPropMutex sync.Mutex
// Clone clones the entire global state.
func (g *Globals) Clone() *Globals {
rc := &Globals{
Version: g.Version,
PostsPerPage: g.PostsPerPage,
OldPostsAtTop: g.OldPostsAtTop,
MaxSearchPage: g.MaxSearchPage,
@@ -126,6 +128,7 @@ func AmReplaceGlobals(ctx context.Context, ng *Globals) error {
if err != nil {
return err
}
ng.Version = theGlobals.Version
ng.flags = nil
theGlobals = ng
return nil