MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / applyLimits

Function applyLimits

openclaw-plugin/src/index.js:368–376  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

366 // 4. Apply spend limits from config
367 if (cfg.spendLimits) {
368 const applyLimits = async () => {
369 await sleep(3000);
370 for (const [window, amount] of Object.entries(cfg.spendLimits)) {
371 if (typeof amount === "number" && amount > 0) {
372 await postJson(`http://127.0.0.1:${port}/v1/spend`, { action: "set", window, amount });
373 }
374 }
375 api.logger.info("Spend limits applied from config");
376 };
377 applyLimits().catch(() => {});
378 }
379

Callers 1

registerFunction · 0.85

Calls 2

postJsonFunction · 0.85
infoMethod · 0.80

Tested by

no test coverage detected