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 { enqueueJob, leaseNextJob, completeJob, failJob } = require('../src/autonomy/jobs');
|
||||
|
||||
@@ -104,8 +104,8 @@ function reconcileLiveBatch(archiveDb, intelligenceDb, batchSize = 250) {
|
||||
}
|
||||
|
||||
async function runAutonomyWorker({ archivePath, intelligencePath, workerId = `autonomy-${os.hostname()}-${process.pid}`, pollMs = 1000 } = {}) {
|
||||
const archiveDb = new Database(archivePath, { readonly: true });
|
||||
const intelligenceDb = new Database(intelligencePath);
|
||||
const archiveDb = openRuntimeDb(archivePath, { schema: 'archive', readonly: true });
|
||||
const intelligenceDb = openRuntimeDb(intelligencePath, { schema: 'intelligence' });
|
||||
intelligenceDb.pragma('journal_mode = WAL');
|
||||
intelligenceDb.pragma('busy_timeout = 5000');
|
||||
initAutonomySchema(intelligenceDb);
|
||||
|
||||
Reference in New Issue
Block a user