Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
Serein207 committed Aug 29, 2024
1 parent 75856c0 commit 365374b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/Controller/Core/ViewManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <Controller/UiBridge.h>
#include <algorithm>
#include <cassert>
#include <memory>
#include <set>
#include <spdlog/spdlog.h>

Expand Down
11 changes: 0 additions & 11 deletions src/Infrastructure/Network/NetworkClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,17 +359,6 @@ std::string NetworkClient::generateCacheKey(http::verb verb,
return key;
}

std::string NetworkClient::generateCacheKey(http::verb verb,
const urls::url_view& url,
const std::initializer_list<urls::param>& params) {
std::string key = std::string(url.data(), url.size()) + "|"
+ std::to_string(static_cast<int>(verb));
for (const auto& param : params) {
key += "|" + std::string(param.key) + "=" + std::string(param.value);
}
return key;
}

urls::url NetworkClient::endpoint(std::string_view endpoint) {
return urls::url(EVENTO_API_GATEWAY + endpoint.data());
}
Expand Down
4 changes: 2 additions & 2 deletions src/Infrastructure/Network/NetworkClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class NetworkClient {
const urls::url_view& url,
const std::initializer_list<urls::param>& params); //auxiliary function to generate cache key

static bool isCacheEntryExpired(const CacheEntry& entry) const {
static bool isCacheEntryExpired(const CacheEntry& entry) {
auto now = std::chrono::steady_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::hours>(now - entry.insertTime);
return duration.count() >= 3;
Expand All @@ -117,7 +117,7 @@ class NetworkClient {
cacheList.erase(it->second);
currentCacheSize -= it->second->second.size;
}
cacheList.emplace_front({key, std::move(entry)});
cacheList.emplace_front(key, std::move(entry));
cacheMap[key] = cacheList.begin();
currentCacheSize += cacheList.begin()->second.size;

Expand Down

0 comments on commit 365374b

Please sign in to comment.