feat: support postgres autonomy runtime
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const os = require('os');
|
||||
const Database = require('better-sqlite3');
|
||||
const { openRuntimeDb } = require('../src/db/runtime');
|
||||
const { initAutonomySchema } = require('../src/autonomy/schema');
|
||||
const { createOrderIntent } = require('../src/autonomy/orderIntents');
|
||||
const { createAlpacaPaperClient } = require('../src/brokers/alpacaPaper');
|
||||
@@ -8,7 +8,7 @@ function sleep(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); }
|
||||
|
||||
async function runExecutionWorker({ intelligencePath, pollMs = 10000, mode = 'shadow', notional = 100, workerId = `execution-${os.hostname()}-${process.pid}` } = {}) {
|
||||
if (!['shadow', 'paper'].includes(mode)) throw new Error(`unsupported execution mode: ${mode}`);
|
||||
const db = new Database(intelligencePath);
|
||||
const db = openRuntimeDb(intelligencePath, { schema: 'intelligence' });
|
||||
db.pragma('journal_mode = WAL');
|
||||
db.pragma('busy_timeout = 5000');
|
||||
initAutonomySchema(db);
|
||||
|
||||
Reference in New Issue
Block a user