From 2cabae1e74c49698ec838dbcb3ff93779c1ed958 Mon Sep 17 00:00:00 2001 From: Alfred Kamanda Date: Mon, 8 Dec 2025 17:29:13 +0300 Subject: [PATCH] use the ResetRoot config to clear the cache once a user quits --- cmd/africastalking/main.go | 9 +++++---- cmd/async/main.go | 9 +++++---- cmd/main.go | 1 + 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cmd/africastalking/main.go b/cmd/africastalking/main.go index 2f34b56..2c5bc53 100644 --- a/cmd/africastalking/main.go +++ b/cmd/africastalking/main.go @@ -79,11 +79,12 @@ func main() { pfp := path.Join(scriptDir, "pp.csv") cfg := engine.Config{ - Root: "root", - OutputSize: uint32(size), - FlagCount: uint32(128), - MenuSeparator: menuSeparator, + Root: "root", + OutputSize: uint32(size), + FlagCount: uint32(128), + MenuSeparator: menuSeparator, ResetOnEmptyInput: true, + ResetRoot: true, // clear the cache once a user quits } if engineDebug { diff --git a/cmd/async/main.go b/cmd/async/main.go index 5bb6816..8b799b9 100644 --- a/cmd/async/main.go +++ b/cmd/async/main.go @@ -94,11 +94,12 @@ func main() { pfp := path.Join(scriptDir, "pp.csv") cfg := engine.Config{ - Root: "root", - OutputSize: uint32(size), - FlagCount: uint32(128), - MenuSeparator: menuSeparator, + Root: "root", + OutputSize: uint32(size), + FlagCount: uint32(128), + MenuSeparator: menuSeparator, ResetOnEmptyInput: true, + ResetRoot: true, // clear the cache once a user quits } if engineDebug { diff --git a/cmd/main.go b/cmd/main.go index 1b40e32..dc3cc72 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -82,6 +82,7 @@ func main() { MenuSeparator: menuSeparator, EngineDebug: engineDebug, ResetOnEmptyInput: true, + ResetRoot: true, // clear the cache once a user quits } menuStorageService := storage.NewMenuStorageService(conns)