all database operations now take a context.Context, which is propagated through from sources

This commit is contained in:
2025-12-20 22:29:26 -07:00
parent 9e6bf2feda
commit 5c8bb8dd5e
39 changed files with 605 additions and 504 deletions
+4 -2
View File
@@ -10,6 +10,7 @@
package ui
import (
"context"
_ "embed"
"fmt"
"slices"
@@ -141,19 +142,20 @@ func AmMenu(name string) *MenuDefinition {
/* AmBuildCommunityMenu buids a community menu for the specified community.
* Parameters:
* ctx - Standard Go context value.
* comm - The community to build the menu for.
* Returns:
* The new menu definition.
* Standard Go error status.
*/
func AmBuildCommunityMenu(comm *database.Community) (*MenuDefinition, error) {
func AmBuildCommunityMenu(ctx context.Context, comm *database.Community) (*MenuDefinition, error) {
menuCacheMutex.Lock()
defer menuCacheMutex.Unlock()
m, ok := menuCache.Get(comm.Id)
if ok {
return m.(*MenuDefinition), nil
}
sdef, err := database.AmGetCommunityServices(comm.Id)
sdef, err := database.AmGetCommunityServices(ctx, comm.Id)
if err != nil {
return nil, err
}