Skip to content

feat(cmd): implement CONFIG GET and CONFIG SET#76

Merged
cankush625 merged 2 commits into
masterfrom
ankushchavan/config-command
May 5, 2026
Merged

feat(cmd): implement CONFIG GET and CONFIG SET#76
cankush625 merged 2 commits into
masterfrom
ankushchavan/config-command

Conversation

@cankush625
Copy link
Copy Markdown
Owner

Implementation

  • Added db/config.go — thread-safe Config struct using sync.RWMutex with Get and Set methods. Package-level ServerConfig instance holds defaults (hz=1, active-expire-enabled=yes, maxmemory=0).
  • Added db/config_helpers.go — type conversion helpers (parseInt, boolToYesNo, etc.) kept separate to avoid cluttering config.go.
  • Updated db/expiry.go — active expiry goroutine now reads CleanupInterval() from ServerConfig on every tick instead of a hardcoded constant. This means CONFIG SET hz takes effect without a server restart.
  • Added cmd/config.go — ConfigCmd handler dispatching to configGet / configSet. Unknown subcommands and unknown parameters return specific error messages.
  • Added common/constants.go — ConfigCmd constant for the command name.
  • Added exc/command_executor.go — wired CONFIG into the executor switch.
  • Added docs/config.md and updated docs/README.md and root README.md.

Issue

#40

cankush625 added 2 commits May 5, 2026 10:57
Signed-off-by: Ankush Chavan <cankush625@gmail.com>
Signed-off-by: Ankush Chavan <cankush625@gmail.com>
Copy link
Copy Markdown
Owner Author

@cankush625 cankush625 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@cankush625 cankush625 merged commit 4f3850e into master May 5, 2026
4 checks passed
@cankush625 cankush625 deleted the ankushchavan/config-command branch May 5, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant