Skip to content

Commit

Permalink
bypass api cache
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaGW2 committed Apr 29, 2024
1 parent dc13a16 commit e25498a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/API/CAPIClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ CAPIClient::~CAPIClient()
LogDebug(("CAPIClient::" + BaseURL).c_str(), "~CAPIClient(%s)", BaseURL.c_str());
}

json CAPIClient::Get(std::string aEndpoint, std::string aParameters)
json CAPIClient::Get(std::string aEndpoint, std::string aParameters, bool aBypassCache)
{
std::string query = GetQuery(aEndpoint, aParameters);

CachedResponse* cachedResponse = GetCachedResponse(query);
CachedResponse* cachedResponse = aBypassCache ? nullptr : GetCachedResponse(query);

if (cachedResponse != nullptr)
{
Expand Down
2 changes: 1 addition & 1 deletion src/API/CAPIClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CAPIClient
Get:
Returns the response string.
*/
json Get(std::string aEndpoint, std::string aParameters = "");
json Get(std::string aEndpoint, std::string aParameters = "", bool aBypassCache = false);

json Post(std::string aEndpoint, std::string aParameters = "");
/*
Expand Down
2 changes: 1 addition & 1 deletion src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ namespace Main
std::filesystem::remove(Path::F_OLD_DLL);
}

json resVersion = RaidcoreAPI->Get("/nexusversion");;
json resVersion = RaidcoreAPI->Get("/nexusversion", "", true);

if (resVersion.is_null())
{
Expand Down

0 comments on commit e25498a

Please sign in to comment.