fix: Use getPrismaClient() instead of this.prisma in Position Manager

This commit is contained in:
mindesbunister
2025-12-13 17:26:56 +01:00
parent 5d5868d802
commit 3c61f42e31

View File

@@ -813,8 +813,9 @@ export class PositionManager {
// CRITICAL FIX (Dec 12, 2025): Check if we have order signatures // CRITICAL FIX (Dec 12, 2025): Check if we have order signatures
// Auto-synced positions may have NULL signatures, need fallback // Auto-synced positions may have NULL signatures, need fallback
const { updateTradeState } = await import('../database/trades') const { updateTradeState, getPrismaClient } = await import('../database/trades')
const dbTrade = await this.prisma.trade.findUnique({ const prisma = getPrismaClient()
const dbTrade = await prisma.trade.findUnique({
where: { id: trade.id }, where: { id: trade.id },
select: { slOrderTx: true, softStopOrderTx: true, hardStopOrderTx: true } select: { slOrderTx: true, softStopOrderTx: true, hardStopOrderTx: true }
}) })