feat(workflow): example stats page with embedded Chart.js, inline form validation errors

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 01:59:27 +02:00
co-authored by Claude Sonnet 5.5
parent 16a0bb0de4
commit 00af65613d
36 changed files with 1274 additions and 138 deletions
+16 -1
View File
@@ -39,15 +39,30 @@ void Cache::put(const std::string& key, const std::string& value, long ttl_sec,
bool Cache::lookup(const std::string& key, std::string& out, long now) {
std::lock_guard<std::mutex> lock(mu_);
auto it = data_.find(key);
if (it == data_.end()) return false;
if (it == data_.end()) {
++misses_;
return false;
}
if (it->second.expires_at <= now) {
data_.erase(it);
++misses_;
return false;
}
out = it->second.value;
++hits_;
return true;
}
long Cache::hits() const {
std::lock_guard<std::mutex> lock(mu_);
return hits_;
}
long Cache::misses() const {
std::lock_guard<std::mutex> lock(mu_);
return misses_;
}
void Cache::invalidate(const std::string& key) {
std::lock_guard<std::mutex> lock(mu_);
data_.erase(key);