MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / start_cert_store_watch_task

Function start_cert_store_watch_task

gateway/src/main_service.rs:557–574  ·  view source on GitHub ↗

Watch for certificate changes from KvStore and update CertStore

(proxy: Proxy)

Source from the content-addressed store, hash-verified

555
556/// Watch for certificate changes from KvStore and update CertStore
557fn start_cert_store_watch_task(proxy: Proxy) {
558 let kv_store = proxy.kv_store.clone();
559
560 // Watch for any certificate changes (all domains)
561 let mut rx = kv_store.watch_all_certs();
562 tokio::spawn(async move {
563 loop {
564 if rx.changed().await.is_err() {
565 break;
566 }
567 info!("WaveKV: detected certificate changes, reloading CertStore...");
568 if let Err(err) = proxy.reload_all_certs_from_kvstore() {
569 error!("Failed to reload certificates from KvStore: {err:?}");
570 }
571 }
572 });
573 info!("CertStore watch task started");
574}
575
576/// Watch for ZT-Domain config changes and auto-renew certificates
577fn start_zt_domain_watch_task(proxy: Proxy) {

Callers 1

start_bg_tasksMethod · 0.85

Calls 3

cloneMethod · 0.80
watch_all_certsMethod · 0.80

Tested by

no test coverage detected