MCPcopy Create free account
hub / github.com/EvoMap/evolver / _withTimeout

Function _withTimeout

src/atp/autoBuyer.js:214–221  ·  view source on GitHub ↗
(promise, timeoutMs)

Source from the content-addressed store, hash-verified

212}
213
214function _withTimeout(promise, timeoutMs) {
215 return Promise.race([
216 promise,
217 new Promise(function (resolve) {
218 setTimeout(function () { resolve({ ok: false, error: 'autobuyer_timeout' }); }, timeoutMs);
219 }),
220 ]);
221}
222
223// Single-flight queue: serialize the read → cap-check → placeOrder → write
224// pipeline so two concurrent considerOrder() calls cannot both pass the cap

Callers 1

_considerOrderSerializedFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected