UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 941 B
import{v as e}from"./openclaw-state-read-home-dir-BQZX1pD2.mjs";import{t}from"./openclaw-state-read-promise-like-3qqJObCs.mjs";import{threadId as n}from"node:worker_threads";const r=e(Symbol.for(`openclaw.databaseProcessRole`),()=>({}));function getDatabaseProcessRole(){return r.role}let i=0;function withEngineStoreAdmission(e){i+=1;try{let n=e();if(t(n))throw Error(`Database engine admission must remain synchronous`);return n}finally{--i}}function assertEngineStoreExecutionAllowed(){if(n===0&&i===0&&r.role!==`cli-oneshot`)throw Error(`PostgreSQL connections must run in a worker; only synchronous admission, migrations, and CLI one-shots may run on the main thread`)}const a=18e5;function resolveAgentDatabaseIdleHandleTtlMs(){return getDatabaseProcessRole()===`cli-oneshot`?3e4:a}export{withEngineStoreAdmission as a,getDatabaseProcessRole as i,resolveAgentDatabaseIdleHandleTtlMs as n,assertEngineStoreExecutionAllowed as r,a as t};