feat(config): served from an in-process cache with a 5 s version check, writes bump the version atomically, mongo and postgres alike, redis keyed by version on top

This commit is contained in:
hh committed 2026-10-08 05:38:09 +02:00
1 parent 4cb3b85321
commit eed732fbcf
4 files changed
+200 -81

No files matched your search

@@ -261,10 +261,9 @@ async def read_config() -> DynamicConfigBase:
async def write_config(config: DynamicConfigBase) -> DynamicConfigBase:
await init_db()
doc = await DynamicConfig.get_or_create()
for name in DynamicConfigBase.model_fields:
setattr(doc, name, getattr(config, name))
await doc.save()
await DynamicConfig.update_config(
**{name: getattr(config, name) for name in DynamicConfigBase.model_fields}
)
return config