Skip to content

Commit

Permalink
Test commit, will be rewritten post testing
Browse files Browse the repository at this point in the history
  • Loading branch information
maneeshpm committed Jan 9, 2022
1 parent ecb1973 commit e8cdcf0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/server/internalServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,17 @@ unsigned parseIllustration(const std::string& s)

// Returns the value of env var `name` if found, otherwise returns defaultVal
unsigned int getCacheLength(const char* name, unsigned int defaultVal) {
std::cout << "retrieving cache size" << endl;
try {
auto envString = std::getenv(name);
const char* envString = std::getenv(name);
if (envString == nullptr) {
throw std::runtime_error("Environment variable not set.");
}
std::cout << "Read string: " << string(envString) << std::endl;
std::cout << "Converted value: " << extractFromString<unsigned int>(envString) << std::endl;
return extractFromString<unsigned int>(envString);
} catch (...) {}
std::cout << "Failed, returning default: " << defaultVal << std::endl;

return defaultVal;
}
Expand Down

0 comments on commit e8cdcf0

Please sign in to comment.