Fix: Re-enable browser cleanup to prevent Chromium resource exhaustion

- Re-enabled cleanup logic in enhanced-screenshot API after screenshot/analysis completion
- Run cleanup in background to avoid blocking responses
- Prevents Chromium processes from spawning indefinitely and consuming resources during automation
This commit is contained in:
mindesbunister
2025-07-22 19:50:20 +02:00
parent 9e93bacdf2
commit dab10868aa
2 changed files with 8 additions and 3 deletions

View File

@@ -60,12 +60,17 @@ export async function GET() {
// Get open orders
const orders = userAccount.orders || []
// Show ALL orders for debugging - not just status 0
// Filter for active orders (status 0 = open)
const activeOrders = orders.filter(order =>
order.status === 0 && !order.baseAssetAmount.isZero()
)
// Show ALL orders for debugging - not just active ones
const allOrders = orders.filter(order =>
!order.baseAssetAmount.isZero() // Only filter out empty orders
)
console.log(`📋 Found ${allOrders.length} total orders (${orders.length} order slots)`)
console.log(`📋 Found ${activeOrders.length} active orders, ${allOrders.length} total orders (${orders.length} order slots)`)
// Debug: log all order statuses
const statusCounts = orders.reduce((acc, order) => {
@@ -74,7 +79,7 @@ export async function GET() {
}, {})
console.log('📊 Order status breakdown:', statusCounts)
const formattedOrders = allOrders.map(order => {
const formattedOrders = activeOrders.map(order => {
const marketIndex = order.marketIndex
const symbol = ['SOL', 'BTC', 'ETH', 'APT', 'AVAX', 'BNB', 'MATIC', 'ARB', 'DOGE', 'OP'][marketIndex] || `UNKNOWN_${marketIndex}`