@adaptic/backend-legacy 0.0.903 → 0.0.905
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ABTest.cjs +291 -63
- package/Account.cjs +291 -63
- package/AccountLinkingRequest.cjs +291 -63
- package/Action.cjs +291 -63
- package/Alert.cjs +291 -63
- package/Allocation.cjs +291 -63
- package/AlpacaAccount.cjs +291 -63
- package/AnalyticsConfiguration.cjs +291 -63
- package/AnalyticsSnapshot.cjs +291 -63
- package/Asset.cjs +291 -63
- package/AuditLog.cjs +291 -63
- package/Authenticator.cjs +291 -63
- package/Configuration.cjs +291 -63
- package/ConflictEvent.cjs +291 -63
- package/ConnectionHealthSnapshot.cjs +291 -63
- package/Customer.cjs +291 -63
- package/DeadLetterMessage.cjs +291 -63
- package/EconomicEvent.cjs +291 -63
- package/Event.cjs +291 -63
- package/EventSnapshot.cjs +291 -63
- package/FeatureImportanceAnalysis.cjs +291 -63
- package/InstitutionalFlowSignal.cjs +291 -63
- package/InstitutionalHolding.cjs +291 -63
- package/InstitutionalSentimentAlerts.cjs +291 -63
- package/InstitutionalSentimentErrors.cjs +291 -63
- package/InstitutionalSentimentHistory.cjs +291 -63
- package/InstitutionalSentimentMetrics.cjs +291 -63
- package/InviteToken.cjs +291 -63
- package/LinkedProvider.cjs +291 -63
- package/MLTrainingData.cjs +291 -63
- package/MarketSentiment.cjs +291 -63
- package/ModelArtifact.cjs +291 -63
- package/ModelVersion.cjs +291 -63
- package/ModelVersionArtifact.cjs +291 -63
- package/NewsArticle.cjs +291 -63
- package/NewsArticleAssetSentiment.cjs +291 -63
- package/OptionsContract.cjs +291 -63
- package/OptionsGreeksHistory.cjs +291 -63
- package/OptionsPosition.cjs +291 -63
- package/OptionsTradeExecution.cjs +291 -63
- package/PortfolioGreeksHistory.cjs +291 -63
- package/ScheduledOptionOrder.cjs +291 -63
- package/Session.cjs +291 -63
- package/SignalGeneratorMetrics.cjs +291 -63
- package/SignalLineage.cjs +291 -63
- package/SignalOutcome.cjs +291 -63
- package/SignalPriorityQueue.cjs +291 -63
- package/SyncEvent.cjs +291 -63
- package/SystemAlert.cjs +291 -63
- package/Trade.cjs +291 -63
- package/TradeAuditEvent.cjs +291 -63
- package/TradeExecutionHistory.cjs +291 -63
- package/User.cjs +291 -63
- package/VerificationToken.cjs +291 -63
- package/WaitlistEntry.cjs +291 -63
- package/esm/ABTest.d.ts.map +1 -1
- package/esm/ABTest.js.map +1 -1
- package/esm/ABTest.mjs +255 -27
- package/esm/Account.d.ts.map +1 -1
- package/esm/Account.js.map +1 -1
- package/esm/Account.mjs +255 -27
- package/esm/AccountLinkingRequest.d.ts.map +1 -1
- package/esm/AccountLinkingRequest.js.map +1 -1
- package/esm/AccountLinkingRequest.mjs +255 -27
- package/esm/Action.d.ts.map +1 -1
- package/esm/Action.js.map +1 -1
- package/esm/Action.mjs +255 -27
- package/esm/Alert.d.ts.map +1 -1
- package/esm/Alert.js.map +1 -1
- package/esm/Alert.mjs +255 -27
- package/esm/Allocation.d.ts.map +1 -1
- package/esm/Allocation.js.map +1 -1
- package/esm/Allocation.mjs +255 -27
- package/esm/AlpacaAccount.d.ts.map +1 -1
- package/esm/AlpacaAccount.js.map +1 -1
- package/esm/AlpacaAccount.mjs +255 -27
- package/esm/AnalyticsConfiguration.d.ts.map +1 -1
- package/esm/AnalyticsConfiguration.js.map +1 -1
- package/esm/AnalyticsConfiguration.mjs +255 -27
- package/esm/AnalyticsSnapshot.d.ts.map +1 -1
- package/esm/AnalyticsSnapshot.js.map +1 -1
- package/esm/AnalyticsSnapshot.mjs +255 -27
- package/esm/Asset.d.ts.map +1 -1
- package/esm/Asset.js.map +1 -1
- package/esm/Asset.mjs +255 -27
- package/esm/AuditLog.d.ts.map +1 -1
- package/esm/AuditLog.js.map +1 -1
- package/esm/AuditLog.mjs +255 -27
- package/esm/Authenticator.d.ts.map +1 -1
- package/esm/Authenticator.js.map +1 -1
- package/esm/Authenticator.mjs +255 -27
- package/esm/Configuration.d.ts.map +1 -1
- package/esm/Configuration.js.map +1 -1
- package/esm/Configuration.mjs +255 -27
- package/esm/ConflictEvent.d.ts.map +1 -1
- package/esm/ConflictEvent.js.map +1 -1
- package/esm/ConflictEvent.mjs +255 -27
- package/esm/ConnectionHealthSnapshot.d.ts.map +1 -1
- package/esm/ConnectionHealthSnapshot.js.map +1 -1
- package/esm/ConnectionHealthSnapshot.mjs +255 -27
- package/esm/Customer.d.ts.map +1 -1
- package/esm/Customer.js.map +1 -1
- package/esm/Customer.mjs +255 -27
- package/esm/DeadLetterMessage.d.ts.map +1 -1
- package/esm/DeadLetterMessage.js.map +1 -1
- package/esm/DeadLetterMessage.mjs +255 -27
- package/esm/EconomicEvent.d.ts.map +1 -1
- package/esm/EconomicEvent.js.map +1 -1
- package/esm/EconomicEvent.mjs +255 -27
- package/esm/Event.d.ts.map +1 -1
- package/esm/Event.js.map +1 -1
- package/esm/Event.mjs +255 -27
- package/esm/EventSnapshot.d.ts.map +1 -1
- package/esm/EventSnapshot.js.map +1 -1
- package/esm/EventSnapshot.mjs +255 -27
- package/esm/FeatureImportanceAnalysis.d.ts.map +1 -1
- package/esm/FeatureImportanceAnalysis.js.map +1 -1
- package/esm/FeatureImportanceAnalysis.mjs +255 -27
- package/esm/InstitutionalFlowSignal.d.ts.map +1 -1
- package/esm/InstitutionalFlowSignal.js.map +1 -1
- package/esm/InstitutionalFlowSignal.mjs +255 -27
- package/esm/InstitutionalHolding.d.ts.map +1 -1
- package/esm/InstitutionalHolding.js.map +1 -1
- package/esm/InstitutionalHolding.mjs +255 -27
- package/esm/InstitutionalSentimentAlerts.d.ts.map +1 -1
- package/esm/InstitutionalSentimentAlerts.js.map +1 -1
- package/esm/InstitutionalSentimentAlerts.mjs +255 -27
- package/esm/InstitutionalSentimentErrors.d.ts.map +1 -1
- package/esm/InstitutionalSentimentErrors.js.map +1 -1
- package/esm/InstitutionalSentimentErrors.mjs +255 -27
- package/esm/InstitutionalSentimentHistory.d.ts.map +1 -1
- package/esm/InstitutionalSentimentHistory.js.map +1 -1
- package/esm/InstitutionalSentimentHistory.mjs +255 -27
- package/esm/InstitutionalSentimentMetrics.d.ts.map +1 -1
- package/esm/InstitutionalSentimentMetrics.js.map +1 -1
- package/esm/InstitutionalSentimentMetrics.mjs +255 -27
- package/esm/InviteToken.d.ts.map +1 -1
- package/esm/InviteToken.js.map +1 -1
- package/esm/InviteToken.mjs +255 -27
- package/esm/LinkedProvider.d.ts.map +1 -1
- package/esm/LinkedProvider.js.map +1 -1
- package/esm/LinkedProvider.mjs +255 -27
- package/esm/MLTrainingData.d.ts.map +1 -1
- package/esm/MLTrainingData.js.map +1 -1
- package/esm/MLTrainingData.mjs +255 -27
- package/esm/MarketSentiment.d.ts.map +1 -1
- package/esm/MarketSentiment.js.map +1 -1
- package/esm/MarketSentiment.mjs +255 -27
- package/esm/ModelArtifact.d.ts.map +1 -1
- package/esm/ModelArtifact.js.map +1 -1
- package/esm/ModelArtifact.mjs +255 -27
- package/esm/ModelVersion.d.ts.map +1 -1
- package/esm/ModelVersion.js.map +1 -1
- package/esm/ModelVersion.mjs +255 -27
- package/esm/ModelVersionArtifact.d.ts.map +1 -1
- package/esm/ModelVersionArtifact.js.map +1 -1
- package/esm/ModelVersionArtifact.mjs +255 -27
- package/esm/NewsArticle.d.ts.map +1 -1
- package/esm/NewsArticle.js.map +1 -1
- package/esm/NewsArticle.mjs +255 -27
- package/esm/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/esm/NewsArticleAssetSentiment.js.map +1 -1
- package/esm/NewsArticleAssetSentiment.mjs +255 -27
- package/esm/OptionsContract.d.ts.map +1 -1
- package/esm/OptionsContract.js.map +1 -1
- package/esm/OptionsContract.mjs +255 -27
- package/esm/OptionsGreeksHistory.d.ts.map +1 -1
- package/esm/OptionsGreeksHistory.js.map +1 -1
- package/esm/OptionsGreeksHistory.mjs +255 -27
- package/esm/OptionsPosition.d.ts.map +1 -1
- package/esm/OptionsPosition.js.map +1 -1
- package/esm/OptionsPosition.mjs +255 -27
- package/esm/OptionsTradeExecution.d.ts.map +1 -1
- package/esm/OptionsTradeExecution.js.map +1 -1
- package/esm/OptionsTradeExecution.mjs +255 -27
- package/esm/PortfolioGreeksHistory.d.ts.map +1 -1
- package/esm/PortfolioGreeksHistory.js.map +1 -1
- package/esm/PortfolioGreeksHistory.mjs +255 -27
- package/esm/ScheduledOptionOrder.d.ts.map +1 -1
- package/esm/ScheduledOptionOrder.js.map +1 -1
- package/esm/ScheduledOptionOrder.mjs +255 -27
- package/esm/Session.d.ts.map +1 -1
- package/esm/Session.js.map +1 -1
- package/esm/Session.mjs +255 -27
- package/esm/SignalGeneratorMetrics.d.ts.map +1 -1
- package/esm/SignalGeneratorMetrics.js.map +1 -1
- package/esm/SignalGeneratorMetrics.mjs +255 -27
- package/esm/SignalLineage.d.ts.map +1 -1
- package/esm/SignalLineage.js.map +1 -1
- package/esm/SignalLineage.mjs +255 -27
- package/esm/SignalOutcome.d.ts.map +1 -1
- package/esm/SignalOutcome.js.map +1 -1
- package/esm/SignalOutcome.mjs +255 -27
- package/esm/SignalPriorityQueue.d.ts.map +1 -1
- package/esm/SignalPriorityQueue.js.map +1 -1
- package/esm/SignalPriorityQueue.mjs +255 -27
- package/esm/SyncEvent.d.ts.map +1 -1
- package/esm/SyncEvent.js.map +1 -1
- package/esm/SyncEvent.mjs +255 -27
- package/esm/SystemAlert.d.ts.map +1 -1
- package/esm/SystemAlert.js.map +1 -1
- package/esm/SystemAlert.mjs +255 -27
- package/esm/Trade.d.ts.map +1 -1
- package/esm/Trade.js.map +1 -1
- package/esm/Trade.mjs +255 -27
- package/esm/TradeAuditEvent.d.ts.map +1 -1
- package/esm/TradeAuditEvent.js.map +1 -1
- package/esm/TradeAuditEvent.mjs +255 -27
- package/esm/TradeExecutionHistory.d.ts.map +1 -1
- package/esm/TradeExecutionHistory.js.map +1 -1
- package/esm/TradeExecutionHistory.mjs +255 -27
- package/esm/User.d.ts.map +1 -1
- package/esm/User.js.map +1 -1
- package/esm/User.mjs +255 -27
- package/esm/VerificationToken.d.ts.map +1 -1
- package/esm/VerificationToken.js.map +1 -1
- package/esm/VerificationToken.mjs +255 -27
- package/esm/WaitlistEntry.d.ts.map +1 -1
- package/esm/WaitlistEntry.js.map +1 -1
- package/esm/WaitlistEntry.mjs +255 -27
- package/esm/middleware/audit-logger.d.ts +0 -7
- package/esm/middleware/audit-logger.d.ts.map +1 -1
- package/esm/middleware/audit-logger.js.map +1 -1
- package/esm/middleware/audit-logger.mjs +5 -3
- package/esm/prismaClient.d.ts.map +1 -1
- package/esm/prismaClient.js.map +1 -1
- package/esm/prismaClient.mjs +38 -9
- package/package.json +1 -1
- package/prismaClient.cjs +38 -9
package/AlpacaAccount.cjs
CHANGED
|
@@ -163,7 +163,7 @@ exports.AlpacaAccount = {
|
|
|
163
163
|
* @returns The created AlpacaAccount or null.
|
|
164
164
|
*/
|
|
165
165
|
async create(props, globalClient) {
|
|
166
|
-
var _a, _b, _c, _d, _e;
|
|
166
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
167
167
|
// Maximum number of retries for database connection issues
|
|
168
168
|
const MAX_RETRIES = 3;
|
|
169
169
|
let retryCount = 0;
|
|
@@ -528,21 +528,52 @@ exports.AlpacaAccount = {
|
|
|
528
528
|
}
|
|
529
529
|
catch (error) {
|
|
530
530
|
lastError = error;
|
|
531
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
532
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
533
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
534
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
535
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
536
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
537
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
538
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
539
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
540
|
+
if (isConstraintViolation) {
|
|
541
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
542
|
+
logger_1.logger.error("Non-retryable constraint violation in createOneAlpacaAccount", {
|
|
543
|
+
operation: 'createOneAlpacaAccount',
|
|
544
|
+
model: 'AlpacaAccount',
|
|
545
|
+
error: String(error),
|
|
546
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
547
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
548
|
+
isRetryable: false,
|
|
549
|
+
});
|
|
550
|
+
throw error;
|
|
551
|
+
}
|
|
531
552
|
// Check if this is a database connection error that we should retry
|
|
532
|
-
const isConnectionError = ((
|
|
533
|
-
((
|
|
534
|
-
((
|
|
535
|
-
((
|
|
536
|
-
(error.networkError && ((
|
|
553
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
554
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
555
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
556
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
557
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
537
558
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
538
559
|
retryCount++;
|
|
539
560
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
540
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
561
|
+
logger_1.logger.warn("Database connection error in createOneAlpacaAccount, retrying...", {
|
|
562
|
+
operation: 'createOneAlpacaAccount',
|
|
563
|
+
model: 'AlpacaAccount',
|
|
564
|
+
attempt: retryCount,
|
|
565
|
+
maxRetries: MAX_RETRIES,
|
|
566
|
+
});
|
|
541
567
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
542
568
|
continue;
|
|
543
569
|
}
|
|
544
|
-
// Log
|
|
545
|
-
logger_1.logger.error("Database
|
|
570
|
+
// Log structured error details and rethrow
|
|
571
|
+
logger_1.logger.error("Database create operation failed", {
|
|
572
|
+
operation: 'createOneAlpacaAccount',
|
|
573
|
+
model: 'AlpacaAccount',
|
|
574
|
+
error: String(error),
|
|
575
|
+
isRetryable: isConnectionError,
|
|
576
|
+
});
|
|
546
577
|
throw error;
|
|
547
578
|
}
|
|
548
579
|
}
|
|
@@ -557,7 +588,7 @@ exports.AlpacaAccount = {
|
|
|
557
588
|
* @returns The count of created records or null.
|
|
558
589
|
*/
|
|
559
590
|
async createMany(props, globalClient) {
|
|
560
|
-
var _a, _b, _c, _d, _e;
|
|
591
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
561
592
|
// Maximum number of retries for database connection issues
|
|
562
593
|
const MAX_RETRIES = 3;
|
|
563
594
|
let retryCount = 0;
|
|
@@ -627,21 +658,52 @@ exports.AlpacaAccount = {
|
|
|
627
658
|
}
|
|
628
659
|
catch (error) {
|
|
629
660
|
lastError = error;
|
|
661
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
662
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
663
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
664
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
665
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
666
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
667
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
668
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
669
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
670
|
+
if (isConstraintViolation) {
|
|
671
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
672
|
+
logger_1.logger.error("Non-retryable constraint violation in createManyAlpacaAccount", {
|
|
673
|
+
operation: 'createManyAlpacaAccount',
|
|
674
|
+
model: 'AlpacaAccount',
|
|
675
|
+
error: String(error),
|
|
676
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
677
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
678
|
+
isRetryable: false,
|
|
679
|
+
});
|
|
680
|
+
throw error;
|
|
681
|
+
}
|
|
630
682
|
// Check if this is a database connection error that we should retry
|
|
631
|
-
const isConnectionError = ((
|
|
632
|
-
((
|
|
633
|
-
((
|
|
634
|
-
((
|
|
635
|
-
(error.networkError && ((
|
|
683
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
684
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
685
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
686
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
687
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
636
688
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
637
689
|
retryCount++;
|
|
638
690
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
639
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
691
|
+
logger_1.logger.warn("Database connection error in createManyAlpacaAccount, retrying...", {
|
|
692
|
+
operation: 'createManyAlpacaAccount',
|
|
693
|
+
model: 'AlpacaAccount',
|
|
694
|
+
attempt: retryCount,
|
|
695
|
+
maxRetries: MAX_RETRIES,
|
|
696
|
+
});
|
|
640
697
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
641
698
|
continue;
|
|
642
699
|
}
|
|
643
|
-
// Log
|
|
644
|
-
logger_1.logger.error("Database
|
|
700
|
+
// Log structured error details and rethrow
|
|
701
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
702
|
+
operation: 'createManyAlpacaAccount',
|
|
703
|
+
model: 'AlpacaAccount',
|
|
704
|
+
error: String(error),
|
|
705
|
+
isRetryable: isConnectionError,
|
|
706
|
+
});
|
|
645
707
|
throw error;
|
|
646
708
|
}
|
|
647
709
|
}
|
|
@@ -656,7 +718,7 @@ exports.AlpacaAccount = {
|
|
|
656
718
|
* @returns The updated AlpacaAccount or null.
|
|
657
719
|
*/
|
|
658
720
|
async update(props, globalClient) {
|
|
659
|
-
var _a, _b, _c, _d, _e;
|
|
721
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
660
722
|
// Maximum number of retries for database connection issues
|
|
661
723
|
const MAX_RETRIES = 3;
|
|
662
724
|
let retryCount = 0;
|
|
@@ -1641,21 +1703,55 @@ exports.AlpacaAccount = {
|
|
|
1641
1703
|
}
|
|
1642
1704
|
catch (error) {
|
|
1643
1705
|
lastError = error;
|
|
1706
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1707
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
1708
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
1709
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
1710
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
1711
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
1712
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
1713
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
1714
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
1715
|
+
if (isConstraintViolation) {
|
|
1716
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
1717
|
+
logger_1.logger.error("Non-retryable constraint violation in updateOneAlpacaAccount", {
|
|
1718
|
+
operation: 'updateOneAlpacaAccount',
|
|
1719
|
+
model: 'AlpacaAccount',
|
|
1720
|
+
error: String(error),
|
|
1721
|
+
recordId: props.id,
|
|
1722
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1723
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1724
|
+
isRetryable: false,
|
|
1725
|
+
});
|
|
1726
|
+
throw error;
|
|
1727
|
+
}
|
|
1644
1728
|
// Check if this is a database connection error that we should retry
|
|
1645
|
-
const isConnectionError = ((
|
|
1646
|
-
((
|
|
1647
|
-
((
|
|
1648
|
-
((
|
|
1649
|
-
(error.networkError && ((
|
|
1729
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
1730
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
1731
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
1732
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1733
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
1650
1734
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1651
1735
|
retryCount++;
|
|
1652
1736
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1653
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
1737
|
+
logger_1.logger.warn("Database connection error in updateOneAlpacaAccount, retrying...", {
|
|
1738
|
+
operation: 'updateOneAlpacaAccount',
|
|
1739
|
+
model: 'AlpacaAccount',
|
|
1740
|
+
attempt: retryCount,
|
|
1741
|
+
maxRetries: MAX_RETRIES,
|
|
1742
|
+
recordId: props.id,
|
|
1743
|
+
});
|
|
1654
1744
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1655
1745
|
continue;
|
|
1656
1746
|
}
|
|
1657
|
-
// Log
|
|
1658
|
-
logger_1.logger.error("Database
|
|
1747
|
+
// Log structured error details and rethrow
|
|
1748
|
+
logger_1.logger.error("Database update operation failed", {
|
|
1749
|
+
operation: 'updateOneAlpacaAccount',
|
|
1750
|
+
model: 'AlpacaAccount',
|
|
1751
|
+
error: String(error),
|
|
1752
|
+
recordId: props.id,
|
|
1753
|
+
isRetryable: isConnectionError,
|
|
1754
|
+
});
|
|
1659
1755
|
throw error;
|
|
1660
1756
|
}
|
|
1661
1757
|
}
|
|
@@ -1670,7 +1766,7 @@ exports.AlpacaAccount = {
|
|
|
1670
1766
|
* @returns The updated AlpacaAccount or null.
|
|
1671
1767
|
*/
|
|
1672
1768
|
async upsert(props, globalClient) {
|
|
1673
|
-
var _a, _b, _c, _d, _e;
|
|
1769
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1674
1770
|
// Maximum number of retries for database connection issues
|
|
1675
1771
|
const MAX_RETRIES = 3;
|
|
1676
1772
|
let retryCount = 0;
|
|
@@ -2969,21 +3065,55 @@ exports.AlpacaAccount = {
|
|
|
2969
3065
|
}
|
|
2970
3066
|
catch (error) {
|
|
2971
3067
|
lastError = error;
|
|
3068
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
3069
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
3070
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
3071
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
3072
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
3073
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
3074
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
3075
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
3076
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
3077
|
+
if (isConstraintViolation) {
|
|
3078
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
3079
|
+
logger_1.logger.error("Non-retryable constraint violation in upsertOneAlpacaAccount", {
|
|
3080
|
+
operation: 'upsertOneAlpacaAccount',
|
|
3081
|
+
model: 'AlpacaAccount',
|
|
3082
|
+
error: String(error),
|
|
3083
|
+
recordId: props.id,
|
|
3084
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
3085
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
3086
|
+
isRetryable: false,
|
|
3087
|
+
});
|
|
3088
|
+
throw error;
|
|
3089
|
+
}
|
|
2972
3090
|
// Check if this is a database connection error that we should retry
|
|
2973
|
-
const isConnectionError = ((
|
|
2974
|
-
((
|
|
2975
|
-
((
|
|
2976
|
-
((
|
|
2977
|
-
(error.networkError && ((
|
|
3091
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
3092
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
3093
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
3094
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
3095
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
2978
3096
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2979
3097
|
retryCount++;
|
|
2980
3098
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2981
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
3099
|
+
logger_1.logger.warn("Database connection error in upsertOneAlpacaAccount, retrying...", {
|
|
3100
|
+
operation: 'upsertOneAlpacaAccount',
|
|
3101
|
+
model: 'AlpacaAccount',
|
|
3102
|
+
attempt: retryCount,
|
|
3103
|
+
maxRetries: MAX_RETRIES,
|
|
3104
|
+
recordId: props.id,
|
|
3105
|
+
});
|
|
2982
3106
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2983
3107
|
continue;
|
|
2984
3108
|
}
|
|
2985
|
-
// Log
|
|
2986
|
-
logger_1.logger.error("Database
|
|
3109
|
+
// Log structured error details and rethrow
|
|
3110
|
+
logger_1.logger.error("Database upsert operation failed", {
|
|
3111
|
+
operation: 'upsertOneAlpacaAccount',
|
|
3112
|
+
model: 'AlpacaAccount',
|
|
3113
|
+
error: String(error),
|
|
3114
|
+
recordId: props.id,
|
|
3115
|
+
isRetryable: isConnectionError,
|
|
3116
|
+
});
|
|
2987
3117
|
throw error;
|
|
2988
3118
|
}
|
|
2989
3119
|
}
|
|
@@ -2998,7 +3128,7 @@ exports.AlpacaAccount = {
|
|
|
2998
3128
|
* @returns The count of created records or null.
|
|
2999
3129
|
*/
|
|
3000
3130
|
async updateMany(props, globalClient) {
|
|
3001
|
-
var _a, _b, _c, _d, _e;
|
|
3131
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
3002
3132
|
// Maximum number of retries for database connection issues
|
|
3003
3133
|
const MAX_RETRIES = 3;
|
|
3004
3134
|
let retryCount = 0;
|
|
@@ -3983,21 +4113,52 @@ exports.AlpacaAccount = {
|
|
|
3983
4113
|
}
|
|
3984
4114
|
catch (error) {
|
|
3985
4115
|
lastError = error;
|
|
4116
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
4117
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
4118
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
4119
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
4120
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
4121
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
4122
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
4123
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
4124
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
4125
|
+
if (isConstraintViolation) {
|
|
4126
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
4127
|
+
logger_1.logger.error("Non-retryable constraint violation in updateManyAlpacaAccount", {
|
|
4128
|
+
operation: 'updateManyAlpacaAccount',
|
|
4129
|
+
model: 'AlpacaAccount',
|
|
4130
|
+
error: String(error),
|
|
4131
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
4132
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
4133
|
+
isRetryable: false,
|
|
4134
|
+
});
|
|
4135
|
+
throw error;
|
|
4136
|
+
}
|
|
3986
4137
|
// Check if this is a database connection error that we should retry
|
|
3987
|
-
const isConnectionError = ((
|
|
3988
|
-
((
|
|
3989
|
-
((
|
|
3990
|
-
((
|
|
3991
|
-
(error.networkError && ((
|
|
4138
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
4139
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
4140
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
4141
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
4142
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
3992
4143
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
3993
4144
|
retryCount++;
|
|
3994
4145
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
3995
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
4146
|
+
logger_1.logger.warn("Database connection error in updateManyAlpacaAccount, retrying...", {
|
|
4147
|
+
operation: 'updateManyAlpacaAccount',
|
|
4148
|
+
model: 'AlpacaAccount',
|
|
4149
|
+
attempt: retryCount,
|
|
4150
|
+
maxRetries: MAX_RETRIES,
|
|
4151
|
+
});
|
|
3996
4152
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
3997
4153
|
continue;
|
|
3998
4154
|
}
|
|
3999
|
-
// Log
|
|
4000
|
-
logger_1.logger.error("Database
|
|
4155
|
+
// Log structured error details and rethrow
|
|
4156
|
+
logger_1.logger.error("Database updateMany operation failed", {
|
|
4157
|
+
operation: 'updateManyAlpacaAccount',
|
|
4158
|
+
model: 'AlpacaAccount',
|
|
4159
|
+
error: String(error),
|
|
4160
|
+
isRetryable: isConnectionError,
|
|
4161
|
+
});
|
|
4001
4162
|
throw error;
|
|
4002
4163
|
}
|
|
4003
4164
|
}
|
|
@@ -4012,7 +4173,7 @@ exports.AlpacaAccount = {
|
|
|
4012
4173
|
* @returns The deleted AlpacaAccount or null.
|
|
4013
4174
|
*/
|
|
4014
4175
|
async delete(props, globalClient) {
|
|
4015
|
-
var _a, _b, _c, _d, _e;
|
|
4176
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
4016
4177
|
// Maximum number of retries for database connection issues
|
|
4017
4178
|
const MAX_RETRIES = 3;
|
|
4018
4179
|
let retryCount = 0;
|
|
@@ -4056,21 +4217,58 @@ exports.AlpacaAccount = {
|
|
|
4056
4217
|
}
|
|
4057
4218
|
catch (error) {
|
|
4058
4219
|
lastError = error;
|
|
4220
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
4221
|
+
// (e.g., foreign key constraints preventing deletion)
|
|
4222
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
4223
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
4224
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
4225
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
4226
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
4227
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
4228
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('23503')) ||
|
|
4229
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2002')) ||
|
|
4230
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('P2003')) ||
|
|
4231
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('P2014'));
|
|
4232
|
+
if (isConstraintViolation) {
|
|
4233
|
+
const constraintMatch = (_l = error.message) === null || _l === void 0 ? void 0 : _l.match(/constraint\s+"([^"]+)"/);
|
|
4234
|
+
logger_1.logger.error("Non-retryable constraint violation in deleteOneAlpacaAccount", {
|
|
4235
|
+
operation: 'deleteOneAlpacaAccount',
|
|
4236
|
+
model: 'AlpacaAccount',
|
|
4237
|
+
error: String(error),
|
|
4238
|
+
recordId: props.id,
|
|
4239
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
4240
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
4241
|
+
isRetryable: false,
|
|
4242
|
+
});
|
|
4243
|
+
throw error;
|
|
4244
|
+
}
|
|
4059
4245
|
// Check if this is a database connection error that we should retry
|
|
4060
|
-
const isConnectionError = ((
|
|
4061
|
-
((
|
|
4062
|
-
((
|
|
4063
|
-
((
|
|
4064
|
-
(error.networkError && ((
|
|
4246
|
+
const isConnectionError = ((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Server has closed the connection')) ||
|
|
4247
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Cannot reach database server')) ||
|
|
4248
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('Connection timed out')) ||
|
|
4249
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
4250
|
+
(error.networkError && ((_r = error.networkError.message) === null || _r === void 0 ? void 0 : _r.includes('Failed to fetch')));
|
|
4065
4251
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
4066
4252
|
retryCount++;
|
|
4067
4253
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
4068
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
4254
|
+
logger_1.logger.warn("Database connection error in deleteOneAlpacaAccount, retrying...", {
|
|
4255
|
+
operation: 'deleteOneAlpacaAccount',
|
|
4256
|
+
model: 'AlpacaAccount',
|
|
4257
|
+
attempt: retryCount,
|
|
4258
|
+
maxRetries: MAX_RETRIES,
|
|
4259
|
+
recordId: props.id,
|
|
4260
|
+
});
|
|
4069
4261
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
4070
4262
|
continue;
|
|
4071
4263
|
}
|
|
4072
|
-
// Log
|
|
4073
|
-
logger_1.logger.error("Database
|
|
4264
|
+
// Log structured error details and rethrow
|
|
4265
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
4266
|
+
operation: 'deleteOneAlpacaAccount',
|
|
4267
|
+
model: 'AlpacaAccount',
|
|
4268
|
+
error: String(error),
|
|
4269
|
+
recordId: props.id,
|
|
4270
|
+
isRetryable: isConnectionError,
|
|
4271
|
+
});
|
|
4074
4272
|
throw error;
|
|
4075
4273
|
}
|
|
4076
4274
|
}
|
|
@@ -4140,12 +4338,22 @@ exports.AlpacaAccount = {
|
|
|
4140
4338
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
4141
4339
|
retryCount++;
|
|
4142
4340
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
4143
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
4341
|
+
logger_1.logger.warn("Database connection error in getAlpacaAccount, retrying...", {
|
|
4342
|
+
operation: 'getAlpacaAccount',
|
|
4343
|
+
model: 'AlpacaAccount',
|
|
4344
|
+
attempt: retryCount,
|
|
4345
|
+
maxRetries: MAX_RETRIES,
|
|
4346
|
+
});
|
|
4144
4347
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
4145
4348
|
continue;
|
|
4146
4349
|
}
|
|
4147
|
-
// Log
|
|
4148
|
-
logger_1.logger.error("Database
|
|
4350
|
+
// Log structured error details and rethrow
|
|
4351
|
+
logger_1.logger.error("Database get operation failed", {
|
|
4352
|
+
operation: 'getAlpacaAccount',
|
|
4353
|
+
model: 'AlpacaAccount',
|
|
4354
|
+
error: String(error),
|
|
4355
|
+
isRetryable: isConnectionError,
|
|
4356
|
+
});
|
|
4149
4357
|
throw error;
|
|
4150
4358
|
}
|
|
4151
4359
|
}
|
|
@@ -4203,12 +4411,22 @@ exports.AlpacaAccount = {
|
|
|
4203
4411
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
4204
4412
|
retryCount++;
|
|
4205
4413
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
4206
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
4414
|
+
logger_1.logger.warn("Database connection error in getAllAlpacaAccount, retrying...", {
|
|
4415
|
+
operation: 'getAllAlpacaAccount',
|
|
4416
|
+
model: 'AlpacaAccount',
|
|
4417
|
+
attempt: retryCount,
|
|
4418
|
+
maxRetries: MAX_RETRIES,
|
|
4419
|
+
});
|
|
4207
4420
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
4208
4421
|
continue;
|
|
4209
4422
|
}
|
|
4210
|
-
// Log
|
|
4211
|
-
logger_1.logger.error("Database
|
|
4423
|
+
// Log structured error details and rethrow
|
|
4424
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
4425
|
+
operation: 'getAllAlpacaAccount',
|
|
4426
|
+
model: 'AlpacaAccount',
|
|
4427
|
+
error: String(error),
|
|
4428
|
+
isRetryable: isConnectionError,
|
|
4429
|
+
});
|
|
4212
4430
|
throw error;
|
|
4213
4431
|
}
|
|
4214
4432
|
}
|
|
@@ -4285,12 +4503,22 @@ exports.AlpacaAccount = {
|
|
|
4285
4503
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
4286
4504
|
retryCount++;
|
|
4287
4505
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
4288
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
4506
|
+
logger_1.logger.warn("Database connection error in findManyAlpacaAccount, retrying...", {
|
|
4507
|
+
operation: 'findManyAlpacaAccount',
|
|
4508
|
+
model: 'AlpacaAccount',
|
|
4509
|
+
attempt: retryCount,
|
|
4510
|
+
maxRetries: MAX_RETRIES,
|
|
4511
|
+
});
|
|
4289
4512
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
4290
4513
|
continue;
|
|
4291
4514
|
}
|
|
4292
|
-
// Log
|
|
4293
|
-
logger_1.logger.error("Database
|
|
4515
|
+
// Log structured error details and rethrow
|
|
4516
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
4517
|
+
operation: 'findManyAlpacaAccount',
|
|
4518
|
+
model: 'AlpacaAccount',
|
|
4519
|
+
error: String(error),
|
|
4520
|
+
isRetryable: isConnectionError,
|
|
4521
|
+
});
|
|
4294
4522
|
throw error;
|
|
4295
4523
|
}
|
|
4296
4524
|
}
|