Skip to content

Configs and Log Refractor - #53

Open
srivastava-yash wants to merge 4 commits into
dicedb:masterfrom
srivastava-yash:f/config-logs-refractor
Open

Configs and Log Refractor#53
srivastava-yash wants to merge 4 commits into
dicedb:masterfrom
srivastava-yash:f/config-logs-refractor

Conversation

@srivastava-yash

@srivastava-yash srivastava-yash commented Oct 28, 2024

Copy link
Copy Markdown

Closes #44

  • Standardise config load at init of server and avoid config.LoadConfig calls across the service.
  • Standardise log library

@srivastava-yash

Copy link
Copy Markdown
Author

@lucifercr07, I have implemented the configs refractor and also added a logging package. I was not entirely sure about the logging package. Happy to hear your suggestions and comments on changing anything.

@srivastava-yash
srivastava-yash marked this pull request as draft October 29, 2024 05:05
@srivastava-yash
srivastava-yash marked this pull request as ready for review October 29, 2024 06:22
func handleCors(w http.ResponseWriter, r *http.Request) bool {
configValue := config.LoadConfig()
allAllowedOrigins := configValue.Server.AllowedOrigins
allAllowedOrigins := config.AppConfig.Server.AllowedOrigins

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not sure why linter is failing here even though the config.LoadConfig is changed here..getting linter error where this function is called in internal/middleware/ratelimiter.go

@lucifercr07

Copy link
Copy Markdown
Contributor

@srivastava-yash can you please fix the build and lint issue.

@srivastava-yash

Copy link
Copy Markdown
Author

Sorry for the delay on this @lucifercr07 , I was traveling. When I am running the lint command locally, I am not getting any errors. I am not sure why linter is failing, I had mentioned this in a comment earlier as well. I will try to debug this.

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.

Remove redundant usage of config load across codebase and refactor logging

2 participants