@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
|
@@ -137,7 +137,7 @@ exports.NewsArticleAssetSentiment = {
|
|
|
137
137
|
* @returns The created NewsArticleAssetSentiment or null.
|
|
138
138
|
*/
|
|
139
139
|
async create(props, globalClient) {
|
|
140
|
-
var _a, _b, _c, _d, _e;
|
|
140
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
141
141
|
// Maximum number of retries for database connection issues
|
|
142
142
|
const MAX_RETRIES = 3;
|
|
143
143
|
let retryCount = 0;
|
|
@@ -332,21 +332,52 @@ exports.NewsArticleAssetSentiment = {
|
|
|
332
332
|
}
|
|
333
333
|
catch (error) {
|
|
334
334
|
lastError = error;
|
|
335
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
336
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
337
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
338
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
339
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
340
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
341
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
342
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
343
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
344
|
+
if (isConstraintViolation) {
|
|
345
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
346
|
+
logger_1.logger.error("Non-retryable constraint violation in createOneNewsArticleAssetSentiment", {
|
|
347
|
+
operation: 'createOneNewsArticleAssetSentiment',
|
|
348
|
+
model: 'NewsArticleAssetSentiment',
|
|
349
|
+
error: String(error),
|
|
350
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
351
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
352
|
+
isRetryable: false,
|
|
353
|
+
});
|
|
354
|
+
throw error;
|
|
355
|
+
}
|
|
335
356
|
// Check if this is a database connection error that we should retry
|
|
336
|
-
const isConnectionError = ((
|
|
337
|
-
((
|
|
338
|
-
((
|
|
339
|
-
((
|
|
340
|
-
(error.networkError && ((
|
|
357
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
358
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
359
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
360
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
361
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
341
362
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
342
363
|
retryCount++;
|
|
343
364
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
344
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
365
|
+
logger_1.logger.warn("Database connection error in createOneNewsArticleAssetSentiment, retrying...", {
|
|
366
|
+
operation: 'createOneNewsArticleAssetSentiment',
|
|
367
|
+
model: 'NewsArticleAssetSentiment',
|
|
368
|
+
attempt: retryCount,
|
|
369
|
+
maxRetries: MAX_RETRIES,
|
|
370
|
+
});
|
|
345
371
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
346
372
|
continue;
|
|
347
373
|
}
|
|
348
|
-
// Log
|
|
349
|
-
logger_1.logger.error("Database
|
|
374
|
+
// Log structured error details and rethrow
|
|
375
|
+
logger_1.logger.error("Database create operation failed", {
|
|
376
|
+
operation: 'createOneNewsArticleAssetSentiment',
|
|
377
|
+
model: 'NewsArticleAssetSentiment',
|
|
378
|
+
error: String(error),
|
|
379
|
+
isRetryable: isConnectionError,
|
|
380
|
+
});
|
|
350
381
|
throw error;
|
|
351
382
|
}
|
|
352
383
|
}
|
|
@@ -361,7 +392,7 @@ exports.NewsArticleAssetSentiment = {
|
|
|
361
392
|
* @returns The count of created records or null.
|
|
362
393
|
*/
|
|
363
394
|
async createMany(props, globalClient) {
|
|
364
|
-
var _a, _b, _c, _d, _e;
|
|
395
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
365
396
|
// Maximum number of retries for database connection issues
|
|
366
397
|
const MAX_RETRIES = 3;
|
|
367
398
|
let retryCount = 0;
|
|
@@ -410,21 +441,52 @@ exports.NewsArticleAssetSentiment = {
|
|
|
410
441
|
}
|
|
411
442
|
catch (error) {
|
|
412
443
|
lastError = error;
|
|
444
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
445
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
446
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
447
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
448
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
449
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
450
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
451
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
452
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
453
|
+
if (isConstraintViolation) {
|
|
454
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
455
|
+
logger_1.logger.error("Non-retryable constraint violation in createManyNewsArticleAssetSentiment", {
|
|
456
|
+
operation: 'createManyNewsArticleAssetSentiment',
|
|
457
|
+
model: 'NewsArticleAssetSentiment',
|
|
458
|
+
error: String(error),
|
|
459
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
460
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
461
|
+
isRetryable: false,
|
|
462
|
+
});
|
|
463
|
+
throw error;
|
|
464
|
+
}
|
|
413
465
|
// Check if this is a database connection error that we should retry
|
|
414
|
-
const isConnectionError = ((
|
|
415
|
-
((
|
|
416
|
-
((
|
|
417
|
-
((
|
|
418
|
-
(error.networkError && ((
|
|
466
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
467
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
468
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
469
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
470
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
419
471
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
420
472
|
retryCount++;
|
|
421
473
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
422
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
474
|
+
logger_1.logger.warn("Database connection error in createManyNewsArticleAssetSentiment, retrying...", {
|
|
475
|
+
operation: 'createManyNewsArticleAssetSentiment',
|
|
476
|
+
model: 'NewsArticleAssetSentiment',
|
|
477
|
+
attempt: retryCount,
|
|
478
|
+
maxRetries: MAX_RETRIES,
|
|
479
|
+
});
|
|
423
480
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
424
481
|
continue;
|
|
425
482
|
}
|
|
426
|
-
// Log
|
|
427
|
-
logger_1.logger.error("Database
|
|
483
|
+
// Log structured error details and rethrow
|
|
484
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
485
|
+
operation: 'createManyNewsArticleAssetSentiment',
|
|
486
|
+
model: 'NewsArticleAssetSentiment',
|
|
487
|
+
error: String(error),
|
|
488
|
+
isRetryable: isConnectionError,
|
|
489
|
+
});
|
|
428
490
|
throw error;
|
|
429
491
|
}
|
|
430
492
|
}
|
|
@@ -439,7 +501,7 @@ exports.NewsArticleAssetSentiment = {
|
|
|
439
501
|
* @returns The updated NewsArticleAssetSentiment or null.
|
|
440
502
|
*/
|
|
441
503
|
async update(props, globalClient) {
|
|
442
|
-
var _a, _b, _c, _d, _e;
|
|
504
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
443
505
|
// Maximum number of retries for database connection issues
|
|
444
506
|
const MAX_RETRIES = 3;
|
|
445
507
|
let retryCount = 0;
|
|
@@ -969,21 +1031,55 @@ exports.NewsArticleAssetSentiment = {
|
|
|
969
1031
|
}
|
|
970
1032
|
catch (error) {
|
|
971
1033
|
lastError = error;
|
|
1034
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1035
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
1036
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
1037
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
1038
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
1039
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
1040
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
1041
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
1042
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
1043
|
+
if (isConstraintViolation) {
|
|
1044
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
1045
|
+
logger_1.logger.error("Non-retryable constraint violation in updateOneNewsArticleAssetSentiment", {
|
|
1046
|
+
operation: 'updateOneNewsArticleAssetSentiment',
|
|
1047
|
+
model: 'NewsArticleAssetSentiment',
|
|
1048
|
+
error: String(error),
|
|
1049
|
+
recordId: props.id,
|
|
1050
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1051
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1052
|
+
isRetryable: false,
|
|
1053
|
+
});
|
|
1054
|
+
throw error;
|
|
1055
|
+
}
|
|
972
1056
|
// Check if this is a database connection error that we should retry
|
|
973
|
-
const isConnectionError = ((
|
|
974
|
-
((
|
|
975
|
-
((
|
|
976
|
-
((
|
|
977
|
-
(error.networkError && ((
|
|
1057
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
1058
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
1059
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
1060
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1061
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
978
1062
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
979
1063
|
retryCount++;
|
|
980
1064
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
981
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
1065
|
+
logger_1.logger.warn("Database connection error in updateOneNewsArticleAssetSentiment, retrying...", {
|
|
1066
|
+
operation: 'updateOneNewsArticleAssetSentiment',
|
|
1067
|
+
model: 'NewsArticleAssetSentiment',
|
|
1068
|
+
attempt: retryCount,
|
|
1069
|
+
maxRetries: MAX_RETRIES,
|
|
1070
|
+
recordId: props.id,
|
|
1071
|
+
});
|
|
982
1072
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
983
1073
|
continue;
|
|
984
1074
|
}
|
|
985
|
-
// Log
|
|
986
|
-
logger_1.logger.error("Database
|
|
1075
|
+
// Log structured error details and rethrow
|
|
1076
|
+
logger_1.logger.error("Database update operation failed", {
|
|
1077
|
+
operation: 'updateOneNewsArticleAssetSentiment',
|
|
1078
|
+
model: 'NewsArticleAssetSentiment',
|
|
1079
|
+
error: String(error),
|
|
1080
|
+
recordId: props.id,
|
|
1081
|
+
isRetryable: isConnectionError,
|
|
1082
|
+
});
|
|
987
1083
|
throw error;
|
|
988
1084
|
}
|
|
989
1085
|
}
|
|
@@ -998,7 +1094,7 @@ exports.NewsArticleAssetSentiment = {
|
|
|
998
1094
|
* @returns The updated NewsArticleAssetSentiment or null.
|
|
999
1095
|
*/
|
|
1000
1096
|
async upsert(props, globalClient) {
|
|
1001
|
-
var _a, _b, _c, _d, _e;
|
|
1097
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1002
1098
|
// Maximum number of retries for database connection issues
|
|
1003
1099
|
const MAX_RETRIES = 3;
|
|
1004
1100
|
let retryCount = 0;
|
|
@@ -1678,21 +1774,55 @@ exports.NewsArticleAssetSentiment = {
|
|
|
1678
1774
|
}
|
|
1679
1775
|
catch (error) {
|
|
1680
1776
|
lastError = error;
|
|
1777
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1778
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
1779
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
1780
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
1781
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
1782
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
1783
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
1784
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
1785
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
1786
|
+
if (isConstraintViolation) {
|
|
1787
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
1788
|
+
logger_1.logger.error("Non-retryable constraint violation in upsertOneNewsArticleAssetSentiment", {
|
|
1789
|
+
operation: 'upsertOneNewsArticleAssetSentiment',
|
|
1790
|
+
model: 'NewsArticleAssetSentiment',
|
|
1791
|
+
error: String(error),
|
|
1792
|
+
recordId: props.id,
|
|
1793
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1794
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1795
|
+
isRetryable: false,
|
|
1796
|
+
});
|
|
1797
|
+
throw error;
|
|
1798
|
+
}
|
|
1681
1799
|
// Check if this is a database connection error that we should retry
|
|
1682
|
-
const isConnectionError = ((
|
|
1683
|
-
((
|
|
1684
|
-
((
|
|
1685
|
-
((
|
|
1686
|
-
(error.networkError && ((
|
|
1800
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
1801
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
1802
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
1803
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1804
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
1687
1805
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1688
1806
|
retryCount++;
|
|
1689
1807
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1690
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
1808
|
+
logger_1.logger.warn("Database connection error in upsertOneNewsArticleAssetSentiment, retrying...", {
|
|
1809
|
+
operation: 'upsertOneNewsArticleAssetSentiment',
|
|
1810
|
+
model: 'NewsArticleAssetSentiment',
|
|
1811
|
+
attempt: retryCount,
|
|
1812
|
+
maxRetries: MAX_RETRIES,
|
|
1813
|
+
recordId: props.id,
|
|
1814
|
+
});
|
|
1691
1815
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1692
1816
|
continue;
|
|
1693
1817
|
}
|
|
1694
|
-
// Log
|
|
1695
|
-
logger_1.logger.error("Database
|
|
1818
|
+
// Log structured error details and rethrow
|
|
1819
|
+
logger_1.logger.error("Database upsert operation failed", {
|
|
1820
|
+
operation: 'upsertOneNewsArticleAssetSentiment',
|
|
1821
|
+
model: 'NewsArticleAssetSentiment',
|
|
1822
|
+
error: String(error),
|
|
1823
|
+
recordId: props.id,
|
|
1824
|
+
isRetryable: isConnectionError,
|
|
1825
|
+
});
|
|
1696
1826
|
throw error;
|
|
1697
1827
|
}
|
|
1698
1828
|
}
|
|
@@ -1707,7 +1837,7 @@ exports.NewsArticleAssetSentiment = {
|
|
|
1707
1837
|
* @returns The count of created records or null.
|
|
1708
1838
|
*/
|
|
1709
1839
|
async updateMany(props, globalClient) {
|
|
1710
|
-
var _a, _b, _c, _d, _e;
|
|
1840
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1711
1841
|
// Maximum number of retries for database connection issues
|
|
1712
1842
|
const MAX_RETRIES = 3;
|
|
1713
1843
|
let retryCount = 0;
|
|
@@ -2237,21 +2367,52 @@ exports.NewsArticleAssetSentiment = {
|
|
|
2237
2367
|
}
|
|
2238
2368
|
catch (error) {
|
|
2239
2369
|
lastError = error;
|
|
2370
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
2371
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
2372
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
2373
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
2374
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
2375
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
2376
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
2377
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
2378
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
2379
|
+
if (isConstraintViolation) {
|
|
2380
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
2381
|
+
logger_1.logger.error("Non-retryable constraint violation in updateManyNewsArticleAssetSentiment", {
|
|
2382
|
+
operation: 'updateManyNewsArticleAssetSentiment',
|
|
2383
|
+
model: 'NewsArticleAssetSentiment',
|
|
2384
|
+
error: String(error),
|
|
2385
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
2386
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
2387
|
+
isRetryable: false,
|
|
2388
|
+
});
|
|
2389
|
+
throw error;
|
|
2390
|
+
}
|
|
2240
2391
|
// Check if this is a database connection error that we should retry
|
|
2241
|
-
const isConnectionError = ((
|
|
2242
|
-
((
|
|
2243
|
-
((
|
|
2244
|
-
((
|
|
2245
|
-
(error.networkError && ((
|
|
2392
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
2393
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
2394
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
2395
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
2396
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
2246
2397
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2247
2398
|
retryCount++;
|
|
2248
2399
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2249
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2400
|
+
logger_1.logger.warn("Database connection error in updateManyNewsArticleAssetSentiment, retrying...", {
|
|
2401
|
+
operation: 'updateManyNewsArticleAssetSentiment',
|
|
2402
|
+
model: 'NewsArticleAssetSentiment',
|
|
2403
|
+
attempt: retryCount,
|
|
2404
|
+
maxRetries: MAX_RETRIES,
|
|
2405
|
+
});
|
|
2250
2406
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2251
2407
|
continue;
|
|
2252
2408
|
}
|
|
2253
|
-
// Log
|
|
2254
|
-
logger_1.logger.error("Database
|
|
2409
|
+
// Log structured error details and rethrow
|
|
2410
|
+
logger_1.logger.error("Database updateMany operation failed", {
|
|
2411
|
+
operation: 'updateManyNewsArticleAssetSentiment',
|
|
2412
|
+
model: 'NewsArticleAssetSentiment',
|
|
2413
|
+
error: String(error),
|
|
2414
|
+
isRetryable: isConnectionError,
|
|
2415
|
+
});
|
|
2255
2416
|
throw error;
|
|
2256
2417
|
}
|
|
2257
2418
|
}
|
|
@@ -2266,7 +2427,7 @@ exports.NewsArticleAssetSentiment = {
|
|
|
2266
2427
|
* @returns The deleted NewsArticleAssetSentiment or null.
|
|
2267
2428
|
*/
|
|
2268
2429
|
async delete(props, globalClient) {
|
|
2269
|
-
var _a, _b, _c, _d, _e;
|
|
2430
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
2270
2431
|
// Maximum number of retries for database connection issues
|
|
2271
2432
|
const MAX_RETRIES = 3;
|
|
2272
2433
|
let retryCount = 0;
|
|
@@ -2310,21 +2471,58 @@ exports.NewsArticleAssetSentiment = {
|
|
|
2310
2471
|
}
|
|
2311
2472
|
catch (error) {
|
|
2312
2473
|
lastError = error;
|
|
2474
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
2475
|
+
// (e.g., foreign key constraints preventing deletion)
|
|
2476
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
2477
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
2478
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
2479
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
2480
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
2481
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
2482
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('23503')) ||
|
|
2483
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2002')) ||
|
|
2484
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('P2003')) ||
|
|
2485
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('P2014'));
|
|
2486
|
+
if (isConstraintViolation) {
|
|
2487
|
+
const constraintMatch = (_l = error.message) === null || _l === void 0 ? void 0 : _l.match(/constraint\s+"([^"]+)"/);
|
|
2488
|
+
logger_1.logger.error("Non-retryable constraint violation in deleteOneNewsArticleAssetSentiment", {
|
|
2489
|
+
operation: 'deleteOneNewsArticleAssetSentiment',
|
|
2490
|
+
model: 'NewsArticleAssetSentiment',
|
|
2491
|
+
error: String(error),
|
|
2492
|
+
recordId: props.id,
|
|
2493
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
2494
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
2495
|
+
isRetryable: false,
|
|
2496
|
+
});
|
|
2497
|
+
throw error;
|
|
2498
|
+
}
|
|
2313
2499
|
// Check if this is a database connection error that we should retry
|
|
2314
|
-
const isConnectionError = ((
|
|
2315
|
-
((
|
|
2316
|
-
((
|
|
2317
|
-
((
|
|
2318
|
-
(error.networkError && ((
|
|
2500
|
+
const isConnectionError = ((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Server has closed the connection')) ||
|
|
2501
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Cannot reach database server')) ||
|
|
2502
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('Connection timed out')) ||
|
|
2503
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
2504
|
+
(error.networkError && ((_r = error.networkError.message) === null || _r === void 0 ? void 0 : _r.includes('Failed to fetch')));
|
|
2319
2505
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2320
2506
|
retryCount++;
|
|
2321
2507
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2322
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2508
|
+
logger_1.logger.warn("Database connection error in deleteOneNewsArticleAssetSentiment, retrying...", {
|
|
2509
|
+
operation: 'deleteOneNewsArticleAssetSentiment',
|
|
2510
|
+
model: 'NewsArticleAssetSentiment',
|
|
2511
|
+
attempt: retryCount,
|
|
2512
|
+
maxRetries: MAX_RETRIES,
|
|
2513
|
+
recordId: props.id,
|
|
2514
|
+
});
|
|
2323
2515
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2324
2516
|
continue;
|
|
2325
2517
|
}
|
|
2326
|
-
// Log
|
|
2327
|
-
logger_1.logger.error("Database
|
|
2518
|
+
// Log structured error details and rethrow
|
|
2519
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
2520
|
+
operation: 'deleteOneNewsArticleAssetSentiment',
|
|
2521
|
+
model: 'NewsArticleAssetSentiment',
|
|
2522
|
+
error: String(error),
|
|
2523
|
+
recordId: props.id,
|
|
2524
|
+
isRetryable: isConnectionError,
|
|
2525
|
+
});
|
|
2328
2526
|
throw error;
|
|
2329
2527
|
}
|
|
2330
2528
|
}
|
|
@@ -2395,12 +2593,22 @@ exports.NewsArticleAssetSentiment = {
|
|
|
2395
2593
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2396
2594
|
retryCount++;
|
|
2397
2595
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2398
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2596
|
+
logger_1.logger.warn("Database connection error in getNewsArticleAssetSentiment, retrying...", {
|
|
2597
|
+
operation: 'getNewsArticleAssetSentiment',
|
|
2598
|
+
model: 'NewsArticleAssetSentiment',
|
|
2599
|
+
attempt: retryCount,
|
|
2600
|
+
maxRetries: MAX_RETRIES,
|
|
2601
|
+
});
|
|
2399
2602
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2400
2603
|
continue;
|
|
2401
2604
|
}
|
|
2402
|
-
// Log
|
|
2403
|
-
logger_1.logger.error("Database
|
|
2605
|
+
// Log structured error details and rethrow
|
|
2606
|
+
logger_1.logger.error("Database get operation failed", {
|
|
2607
|
+
operation: 'getNewsArticleAssetSentiment',
|
|
2608
|
+
model: 'NewsArticleAssetSentiment',
|
|
2609
|
+
error: String(error),
|
|
2610
|
+
isRetryable: isConnectionError,
|
|
2611
|
+
});
|
|
2404
2612
|
throw error;
|
|
2405
2613
|
}
|
|
2406
2614
|
}
|
|
@@ -2458,12 +2666,22 @@ exports.NewsArticleAssetSentiment = {
|
|
|
2458
2666
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2459
2667
|
retryCount++;
|
|
2460
2668
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2461
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2669
|
+
logger_1.logger.warn("Database connection error in getAllNewsArticleAssetSentiment, retrying...", {
|
|
2670
|
+
operation: 'getAllNewsArticleAssetSentiment',
|
|
2671
|
+
model: 'NewsArticleAssetSentiment',
|
|
2672
|
+
attempt: retryCount,
|
|
2673
|
+
maxRetries: MAX_RETRIES,
|
|
2674
|
+
});
|
|
2462
2675
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2463
2676
|
continue;
|
|
2464
2677
|
}
|
|
2465
|
-
// Log
|
|
2466
|
-
logger_1.logger.error("Database
|
|
2678
|
+
// Log structured error details and rethrow
|
|
2679
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
2680
|
+
operation: 'getAllNewsArticleAssetSentiment',
|
|
2681
|
+
model: 'NewsArticleAssetSentiment',
|
|
2682
|
+
error: String(error),
|
|
2683
|
+
isRetryable: isConnectionError,
|
|
2684
|
+
});
|
|
2467
2685
|
throw error;
|
|
2468
2686
|
}
|
|
2469
2687
|
}
|
|
@@ -2543,12 +2761,22 @@ exports.NewsArticleAssetSentiment = {
|
|
|
2543
2761
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2544
2762
|
retryCount++;
|
|
2545
2763
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2546
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2764
|
+
logger_1.logger.warn("Database connection error in findManyNewsArticleAssetSentiment, retrying...", {
|
|
2765
|
+
operation: 'findManyNewsArticleAssetSentiment',
|
|
2766
|
+
model: 'NewsArticleAssetSentiment',
|
|
2767
|
+
attempt: retryCount,
|
|
2768
|
+
maxRetries: MAX_RETRIES,
|
|
2769
|
+
});
|
|
2547
2770
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2548
2771
|
continue;
|
|
2549
2772
|
}
|
|
2550
|
-
// Log
|
|
2551
|
-
logger_1.logger.error("Database
|
|
2773
|
+
// Log structured error details and rethrow
|
|
2774
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
2775
|
+
operation: 'findManyNewsArticleAssetSentiment',
|
|
2776
|
+
model: 'NewsArticleAssetSentiment',
|
|
2777
|
+
error: String(error),
|
|
2778
|
+
isRetryable: isConnectionError,
|
|
2779
|
+
});
|
|
2552
2780
|
throw error;
|
|
2553
2781
|
}
|
|
2554
2782
|
}
|