proxy: Report warm cold start if connection is from the local cache (#7104)

## Problem

* quotes in serialized string
* no status if connection is from local cache

## Summary of changes

* remove quotes
* report warm if connection if from local cache
This commit is contained in:
Anna Khanova
2024-03-13 15:45:19 +04:00
committed by GitHub
parent 83855a907c
commit 0554bee022
4 changed files with 18 additions and 7 deletions

View File

@@ -6,7 +6,9 @@ use super::{
ApiCaches, ApiLocks, AuthInfo, AuthSecret, CachedAllowedIps, CachedNodeInfo, CachedRoleSecret,
NodeInfo,
};
use crate::{auth::backend::ComputeUserInfo, compute, http, scram};
use crate::{
auth::backend::ComputeUserInfo, compute, console::messages::ColdStartInfo, http, scram,
};
use crate::{
cache::Cached,
context::RequestMonitoring,
@@ -254,6 +256,7 @@ impl super::Api for Api {
if permit.should_check_cache() {
if let Some(cached) = self.caches.node_info.get(&key) {
info!(key = &*key, "found cached compute node info");
ctx.set_cold_start_info(ColdStartInfo::Warm);
return Ok(cached);
}
}