mirror of
https://gitcode.com/JianFeeeee/ModelRouter.git
synced 2026-10-03 23:54:06 +00:00
The auth rule calls readAdminKey() on every outbound request so injection never depends on ordering. Once the sealed-config path shells out to the core, that turns each request into a process spawn: 200 simulated requests took 1012ms and launched 200 cores. Cache the unsealed key against config.yaml's mtime. Editing the config still invalidates it, which is what the auth rule actually needs -- the port rewrite, the first write, and a user edit all change mtime. Measured: 200 requests now cost 10ms and one spawn. Only a successful unseal is cached. Caching a failure would pin an empty key until the config next changes, turning a momentary spawn error into a locked out user.