openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 755 B
JavaScript
import{ot as e}from"./openclaw-state-read-sqlite-database-admission-Ck6VG7rE.mjs";import{n as t,u as n}from"./openclaw-state-read-gateway-state-owner-BJTFuTQ0.mjs";import{a as r,n as i}from"./openclaw-state-read-node-sqlite-UqZdY7HG.mjs";const a=/* @__PURE__ */ new Set;function closeSourceRead(e){try{e.close()}finally{e.isOpen&&a.add(e)}}function withSqliteSourceReadDatabase(a,o,s,c={}){let openAdmitted=n=>{let s=e(o,()=>i(c.readOnlyShm?r(a):a,{readOnly:!0,timeout:n}));try{return t(a),s}catch(e){throw closeSourceRead(s),e}};c.waitForAdmission||t(a);let l=c.waitForAdmission?n({databasePath:a,busyTimeoutMs:c.timeout},e=>openAdmitted(e())):openAdmitted(c.timeout);try{return s(l)}finally{closeSourceRead(l)}}export{withSqliteSourceReadDatabase as t};