Skip to content

Introduce enviroment variables to tweak builds faster #16

Description

@Ataba29

With stress testing being implemented soon, there needs to be some configurations made for the project to allow tests to be able to run without having to rebuild the entire project just to disable or enable some functionality of the project.

For example, in Server.cpp we have the following block of code:

// Check rate limit
if (!rt.isAllowed(clientIP))
{
std::cout << "[RATELIMIT] Blocked IP: " << clientIP << "\n";
CloseSocket(AcceptSocket);
continue;
}

It would be ideal if we could edit the rate-limiting feature without rebuilding. I have been thinking about using Docker arguments like this:

docker run -d -p 6625:6625 -e KV_DISABLE_RATE_LIMIT=1 --name kv-test kv-db:latest

The possible solution that I got is this

disableRateLimit = std::getenv("KV_DISABLE_RATE_LIMIT") != nullptr;

Need to figure out where to use it and how to use it prob server, and when the check happens for rate limiting, we also check for disableRateLimit

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions