perf(kv): push keys to vaults concurrently, log one summary per title

Vaults.add_key and add_keys now push to every vault at the same time, so one unreachable vault costs its own timeout instead of the sum. MySQL defaults connect_timeout to vault_timeout.
This commit is contained in:
imSp4rky
2026-09-04 09:13:31 -06:00
parent 1997a92c08
commit b391ffc80a
6 changed files with 63 additions and 37 deletions
+2
View File
@@ -5,6 +5,7 @@ from uuid import UUID
import pymysql
from pymysql.cursors import DictCursor
from unshackle.core.config import config
from unshackle.core.vault import Vault
@@ -18,6 +19,7 @@ class MySQL(Vault):
"""
super().__init__(name, no_push)
self.slug = f"{host}:{database}:{username}"
kwargs.setdefault("connect_timeout", config.vault_timeout or 10)
self.conn_factory = ConnectionFactory(
dict(host=host, db=database, user=username, cursorclass=DictCursor, **kwargs)
)