feat: add autonomous paper-trading and calibration pipeline
This commit is contained in:
+14
-1
@@ -6,7 +6,20 @@ let statusCacheAt = 0;
|
||||
const STATUS_CACHE_TTL_MS = 30 * 1000;
|
||||
|
||||
async function statusRoutes(fastify) {
|
||||
fastify.get('/status', async () => {
|
||||
fastify.get('/status', async (request) => {
|
||||
const deep = String(request.query?.deep || '').toLowerCase() === 'true';
|
||||
if (!deep) {
|
||||
const sequence = db.prepare("SELECT seq FROM sqlite_sequence WHERE name = 'articles'").get();
|
||||
return {
|
||||
total: sequence ? sequence.seq : 0,
|
||||
usable: null,
|
||||
lastIngestionBySource: getLastIngestionBySource(),
|
||||
bySource: null,
|
||||
embeddingModels: null,
|
||||
mode: 'lightweight',
|
||||
deep_status_url: '/status?deep=true',
|
||||
};
|
||||
}
|
||||
const now = Date.now();
|
||||
if (statusCache && now - statusCacheAt < STATUS_CACHE_TTL_MS) {
|
||||
return statusCache;
|
||||
|
||||
Reference in New Issue
Block a user