added aws lambda adapter + improvements to handle concurrency

This commit is contained in:
dswbx
2025-03-03 15:42:42 +01:00
parent 1a72b9e84b
commit 675a39ad5c
22 changed files with 488 additions and 42 deletions

View File

@@ -47,19 +47,29 @@ export function BkndProvider({
const api = useApi();
async function reloadSchema() {
await fetchSchema(includeSecrets, true);
await fetchSchema(includeSecrets, {
force: true,
fresh: true,
});
}
async function fetchSchema(_includeSecrets: boolean = false, force?: boolean) {
async function fetchSchema(
_includeSecrets: boolean = false,
opts?: {
force?: boolean;
fresh?: boolean;
},
) {
const requesting = withSecrets ? Fetching.Secrets : Fetching.Schema;
if (fetching.current === requesting) return;
if (withSecrets && !force) return;
if (withSecrets && opts?.force !== true) return;
fetching.current = requesting;
const res = await api.system.readSchema({
config: true,
secrets: _includeSecrets,
fresh: opts?.fresh,
});
if (!res.ok) {