@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
|
@@ -113,7 +113,7 @@ exports.InstitutionalFlowSignal = {
|
|
|
113
113
|
* @returns The created InstitutionalFlowSignal or null.
|
|
114
114
|
*/
|
|
115
115
|
async create(props, globalClient) {
|
|
116
|
-
var _a, _b, _c, _d, _e;
|
|
116
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
117
117
|
// Maximum number of retries for database connection issues
|
|
118
118
|
const MAX_RETRIES = 3;
|
|
119
119
|
let retryCount = 0;
|
|
@@ -309,21 +309,52 @@ exports.InstitutionalFlowSignal = {
|
|
|
309
309
|
}
|
|
310
310
|
catch (error) {
|
|
311
311
|
lastError = error;
|
|
312
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
313
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
314
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
315
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
316
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
317
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
318
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
319
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
320
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
321
|
+
if (isConstraintViolation) {
|
|
322
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
323
|
+
logger_1.logger.error("Non-retryable constraint violation in createOneInstitutionalFlowSignal", {
|
|
324
|
+
operation: 'createOneInstitutionalFlowSignal',
|
|
325
|
+
model: 'InstitutionalFlowSignal',
|
|
326
|
+
error: String(error),
|
|
327
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
328
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
329
|
+
isRetryable: false,
|
|
330
|
+
});
|
|
331
|
+
throw error;
|
|
332
|
+
}
|
|
312
333
|
// Check if this is a database connection error that we should retry
|
|
313
|
-
const isConnectionError = ((
|
|
314
|
-
((
|
|
315
|
-
((
|
|
316
|
-
((
|
|
317
|
-
(error.networkError && ((
|
|
334
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
335
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
336
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
337
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
338
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
318
339
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
319
340
|
retryCount++;
|
|
320
341
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
321
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
342
|
+
logger_1.logger.warn("Database connection error in createOneInstitutionalFlowSignal, retrying...", {
|
|
343
|
+
operation: 'createOneInstitutionalFlowSignal',
|
|
344
|
+
model: 'InstitutionalFlowSignal',
|
|
345
|
+
attempt: retryCount,
|
|
346
|
+
maxRetries: MAX_RETRIES,
|
|
347
|
+
});
|
|
322
348
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
323
349
|
continue;
|
|
324
350
|
}
|
|
325
|
-
// Log
|
|
326
|
-
logger_1.logger.error("Database
|
|
351
|
+
// Log structured error details and rethrow
|
|
352
|
+
logger_1.logger.error("Database create operation failed", {
|
|
353
|
+
operation: 'createOneInstitutionalFlowSignal',
|
|
354
|
+
model: 'InstitutionalFlowSignal',
|
|
355
|
+
error: String(error),
|
|
356
|
+
isRetryable: isConnectionError,
|
|
357
|
+
});
|
|
327
358
|
throw error;
|
|
328
359
|
}
|
|
329
360
|
}
|
|
@@ -338,7 +369,7 @@ exports.InstitutionalFlowSignal = {
|
|
|
338
369
|
* @returns The count of created records or null.
|
|
339
370
|
*/
|
|
340
371
|
async createMany(props, globalClient) {
|
|
341
|
-
var _a, _b, _c, _d, _e;
|
|
372
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
342
373
|
// Maximum number of retries for database connection issues
|
|
343
374
|
const MAX_RETRIES = 3;
|
|
344
375
|
let retryCount = 0;
|
|
@@ -385,21 +416,52 @@ exports.InstitutionalFlowSignal = {
|
|
|
385
416
|
}
|
|
386
417
|
catch (error) {
|
|
387
418
|
lastError = error;
|
|
419
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
420
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
421
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
422
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
423
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
424
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
425
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
426
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
427
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
428
|
+
if (isConstraintViolation) {
|
|
429
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
430
|
+
logger_1.logger.error("Non-retryable constraint violation in createManyInstitutionalFlowSignal", {
|
|
431
|
+
operation: 'createManyInstitutionalFlowSignal',
|
|
432
|
+
model: 'InstitutionalFlowSignal',
|
|
433
|
+
error: String(error),
|
|
434
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
435
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
436
|
+
isRetryable: false,
|
|
437
|
+
});
|
|
438
|
+
throw error;
|
|
439
|
+
}
|
|
388
440
|
// Check if this is a database connection error that we should retry
|
|
389
|
-
const isConnectionError = ((
|
|
390
|
-
((
|
|
391
|
-
((
|
|
392
|
-
((
|
|
393
|
-
(error.networkError && ((
|
|
441
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
442
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
443
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
444
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
445
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
394
446
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
395
447
|
retryCount++;
|
|
396
448
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
397
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
449
|
+
logger_1.logger.warn("Database connection error in createManyInstitutionalFlowSignal, retrying...", {
|
|
450
|
+
operation: 'createManyInstitutionalFlowSignal',
|
|
451
|
+
model: 'InstitutionalFlowSignal',
|
|
452
|
+
attempt: retryCount,
|
|
453
|
+
maxRetries: MAX_RETRIES,
|
|
454
|
+
});
|
|
398
455
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
399
456
|
continue;
|
|
400
457
|
}
|
|
401
|
-
// Log
|
|
402
|
-
logger_1.logger.error("Database
|
|
458
|
+
// Log structured error details and rethrow
|
|
459
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
460
|
+
operation: 'createManyInstitutionalFlowSignal',
|
|
461
|
+
model: 'InstitutionalFlowSignal',
|
|
462
|
+
error: String(error),
|
|
463
|
+
isRetryable: isConnectionError,
|
|
464
|
+
});
|
|
403
465
|
throw error;
|
|
404
466
|
}
|
|
405
467
|
}
|
|
@@ -414,7 +476,7 @@ exports.InstitutionalFlowSignal = {
|
|
|
414
476
|
* @returns The updated InstitutionalFlowSignal or null.
|
|
415
477
|
*/
|
|
416
478
|
async update(props, globalClient) {
|
|
417
|
-
var _a, _b, _c, _d, _e;
|
|
479
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
418
480
|
// Maximum number of retries for database connection issues
|
|
419
481
|
const MAX_RETRIES = 3;
|
|
420
482
|
let retryCount = 0;
|
|
@@ -1023,21 +1085,55 @@ exports.InstitutionalFlowSignal = {
|
|
|
1023
1085
|
}
|
|
1024
1086
|
catch (error) {
|
|
1025
1087
|
lastError = error;
|
|
1088
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1089
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
1090
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
1091
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
1092
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
1093
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
1094
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
1095
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
1096
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
1097
|
+
if (isConstraintViolation) {
|
|
1098
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
1099
|
+
logger_1.logger.error("Non-retryable constraint violation in updateOneInstitutionalFlowSignal", {
|
|
1100
|
+
operation: 'updateOneInstitutionalFlowSignal',
|
|
1101
|
+
model: 'InstitutionalFlowSignal',
|
|
1102
|
+
error: String(error),
|
|
1103
|
+
recordId: props.id,
|
|
1104
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1105
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1106
|
+
isRetryable: false,
|
|
1107
|
+
});
|
|
1108
|
+
throw error;
|
|
1109
|
+
}
|
|
1026
1110
|
// Check if this is a database connection error that we should retry
|
|
1027
|
-
const isConnectionError = ((
|
|
1028
|
-
((
|
|
1029
|
-
((
|
|
1030
|
-
((
|
|
1031
|
-
(error.networkError && ((
|
|
1111
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
1112
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
1113
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
1114
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1115
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
1032
1116
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1033
1117
|
retryCount++;
|
|
1034
1118
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1035
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
1119
|
+
logger_1.logger.warn("Database connection error in updateOneInstitutionalFlowSignal, retrying...", {
|
|
1120
|
+
operation: 'updateOneInstitutionalFlowSignal',
|
|
1121
|
+
model: 'InstitutionalFlowSignal',
|
|
1122
|
+
attempt: retryCount,
|
|
1123
|
+
maxRetries: MAX_RETRIES,
|
|
1124
|
+
recordId: props.id,
|
|
1125
|
+
});
|
|
1036
1126
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1037
1127
|
continue;
|
|
1038
1128
|
}
|
|
1039
|
-
// Log
|
|
1040
|
-
logger_1.logger.error("Database
|
|
1129
|
+
// Log structured error details and rethrow
|
|
1130
|
+
logger_1.logger.error("Database update operation failed", {
|
|
1131
|
+
operation: 'updateOneInstitutionalFlowSignal',
|
|
1132
|
+
model: 'InstitutionalFlowSignal',
|
|
1133
|
+
error: String(error),
|
|
1134
|
+
recordId: props.id,
|
|
1135
|
+
isRetryable: isConnectionError,
|
|
1136
|
+
});
|
|
1041
1137
|
throw error;
|
|
1042
1138
|
}
|
|
1043
1139
|
}
|
|
@@ -1052,7 +1148,7 @@ exports.InstitutionalFlowSignal = {
|
|
|
1052
1148
|
* @returns The updated InstitutionalFlowSignal or null.
|
|
1053
1149
|
*/
|
|
1054
1150
|
async upsert(props, globalClient) {
|
|
1055
|
-
var _a, _b, _c, _d, _e;
|
|
1151
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1056
1152
|
// Maximum number of retries for database connection issues
|
|
1057
1153
|
const MAX_RETRIES = 3;
|
|
1058
1154
|
let retryCount = 0;
|
|
@@ -1809,21 +1905,55 @@ exports.InstitutionalFlowSignal = {
|
|
|
1809
1905
|
}
|
|
1810
1906
|
catch (error) {
|
|
1811
1907
|
lastError = error;
|
|
1908
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1909
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
1910
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
1911
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
1912
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
1913
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
1914
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
1915
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
1916
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
1917
|
+
if (isConstraintViolation) {
|
|
1918
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
1919
|
+
logger_1.logger.error("Non-retryable constraint violation in upsertOneInstitutionalFlowSignal", {
|
|
1920
|
+
operation: 'upsertOneInstitutionalFlowSignal',
|
|
1921
|
+
model: 'InstitutionalFlowSignal',
|
|
1922
|
+
error: String(error),
|
|
1923
|
+
recordId: props.id,
|
|
1924
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1925
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1926
|
+
isRetryable: false,
|
|
1927
|
+
});
|
|
1928
|
+
throw error;
|
|
1929
|
+
}
|
|
1812
1930
|
// Check if this is a database connection error that we should retry
|
|
1813
|
-
const isConnectionError = ((
|
|
1814
|
-
((
|
|
1815
|
-
((
|
|
1816
|
-
((
|
|
1817
|
-
(error.networkError && ((
|
|
1931
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
1932
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
1933
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
1934
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1935
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
1818
1936
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1819
1937
|
retryCount++;
|
|
1820
1938
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1821
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
1939
|
+
logger_1.logger.warn("Database connection error in upsertOneInstitutionalFlowSignal, retrying...", {
|
|
1940
|
+
operation: 'upsertOneInstitutionalFlowSignal',
|
|
1941
|
+
model: 'InstitutionalFlowSignal',
|
|
1942
|
+
attempt: retryCount,
|
|
1943
|
+
maxRetries: MAX_RETRIES,
|
|
1944
|
+
recordId: props.id,
|
|
1945
|
+
});
|
|
1822
1946
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1823
1947
|
continue;
|
|
1824
1948
|
}
|
|
1825
|
-
// Log
|
|
1826
|
-
logger_1.logger.error("Database
|
|
1949
|
+
// Log structured error details and rethrow
|
|
1950
|
+
logger_1.logger.error("Database upsert operation failed", {
|
|
1951
|
+
operation: 'upsertOneInstitutionalFlowSignal',
|
|
1952
|
+
model: 'InstitutionalFlowSignal',
|
|
1953
|
+
error: String(error),
|
|
1954
|
+
recordId: props.id,
|
|
1955
|
+
isRetryable: isConnectionError,
|
|
1956
|
+
});
|
|
1827
1957
|
throw error;
|
|
1828
1958
|
}
|
|
1829
1959
|
}
|
|
@@ -1838,7 +1968,7 @@ exports.InstitutionalFlowSignal = {
|
|
|
1838
1968
|
* @returns The count of created records or null.
|
|
1839
1969
|
*/
|
|
1840
1970
|
async updateMany(props, globalClient) {
|
|
1841
|
-
var _a, _b, _c, _d, _e;
|
|
1971
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1842
1972
|
// Maximum number of retries for database connection issues
|
|
1843
1973
|
const MAX_RETRIES = 3;
|
|
1844
1974
|
let retryCount = 0;
|
|
@@ -2447,21 +2577,52 @@ exports.InstitutionalFlowSignal = {
|
|
|
2447
2577
|
}
|
|
2448
2578
|
catch (error) {
|
|
2449
2579
|
lastError = error;
|
|
2580
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
2581
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
2582
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
2583
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
2584
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
2585
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
2586
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
2587
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
2588
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
2589
|
+
if (isConstraintViolation) {
|
|
2590
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
2591
|
+
logger_1.logger.error("Non-retryable constraint violation in updateManyInstitutionalFlowSignal", {
|
|
2592
|
+
operation: 'updateManyInstitutionalFlowSignal',
|
|
2593
|
+
model: 'InstitutionalFlowSignal',
|
|
2594
|
+
error: String(error),
|
|
2595
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
2596
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
2597
|
+
isRetryable: false,
|
|
2598
|
+
});
|
|
2599
|
+
throw error;
|
|
2600
|
+
}
|
|
2450
2601
|
// Check if this is a database connection error that we should retry
|
|
2451
|
-
const isConnectionError = ((
|
|
2452
|
-
((
|
|
2453
|
-
((
|
|
2454
|
-
((
|
|
2455
|
-
(error.networkError && ((
|
|
2602
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
2603
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
2604
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
2605
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
2606
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
2456
2607
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2457
2608
|
retryCount++;
|
|
2458
2609
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2459
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2610
|
+
logger_1.logger.warn("Database connection error in updateManyInstitutionalFlowSignal, retrying...", {
|
|
2611
|
+
operation: 'updateManyInstitutionalFlowSignal',
|
|
2612
|
+
model: 'InstitutionalFlowSignal',
|
|
2613
|
+
attempt: retryCount,
|
|
2614
|
+
maxRetries: MAX_RETRIES,
|
|
2615
|
+
});
|
|
2460
2616
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2461
2617
|
continue;
|
|
2462
2618
|
}
|
|
2463
|
-
// Log
|
|
2464
|
-
logger_1.logger.error("Database
|
|
2619
|
+
// Log structured error details and rethrow
|
|
2620
|
+
logger_1.logger.error("Database updateMany operation failed", {
|
|
2621
|
+
operation: 'updateManyInstitutionalFlowSignal',
|
|
2622
|
+
model: 'InstitutionalFlowSignal',
|
|
2623
|
+
error: String(error),
|
|
2624
|
+
isRetryable: isConnectionError,
|
|
2625
|
+
});
|
|
2465
2626
|
throw error;
|
|
2466
2627
|
}
|
|
2467
2628
|
}
|
|
@@ -2476,7 +2637,7 @@ exports.InstitutionalFlowSignal = {
|
|
|
2476
2637
|
* @returns The deleted InstitutionalFlowSignal or null.
|
|
2477
2638
|
*/
|
|
2478
2639
|
async delete(props, globalClient) {
|
|
2479
|
-
var _a, _b, _c, _d, _e;
|
|
2640
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
2480
2641
|
// Maximum number of retries for database connection issues
|
|
2481
2642
|
const MAX_RETRIES = 3;
|
|
2482
2643
|
let retryCount = 0;
|
|
@@ -2520,21 +2681,58 @@ exports.InstitutionalFlowSignal = {
|
|
|
2520
2681
|
}
|
|
2521
2682
|
catch (error) {
|
|
2522
2683
|
lastError = error;
|
|
2684
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
2685
|
+
// (e.g., foreign key constraints preventing deletion)
|
|
2686
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
2687
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
2688
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
2689
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
2690
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
2691
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
2692
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('23503')) ||
|
|
2693
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2002')) ||
|
|
2694
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('P2003')) ||
|
|
2695
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('P2014'));
|
|
2696
|
+
if (isConstraintViolation) {
|
|
2697
|
+
const constraintMatch = (_l = error.message) === null || _l === void 0 ? void 0 : _l.match(/constraint\s+"([^"]+)"/);
|
|
2698
|
+
logger_1.logger.error("Non-retryable constraint violation in deleteOneInstitutionalFlowSignal", {
|
|
2699
|
+
operation: 'deleteOneInstitutionalFlowSignal',
|
|
2700
|
+
model: 'InstitutionalFlowSignal',
|
|
2701
|
+
error: String(error),
|
|
2702
|
+
recordId: props.id,
|
|
2703
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
2704
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
2705
|
+
isRetryable: false,
|
|
2706
|
+
});
|
|
2707
|
+
throw error;
|
|
2708
|
+
}
|
|
2523
2709
|
// Check if this is a database connection error that we should retry
|
|
2524
|
-
const isConnectionError = ((
|
|
2525
|
-
((
|
|
2526
|
-
((
|
|
2527
|
-
((
|
|
2528
|
-
(error.networkError && ((
|
|
2710
|
+
const isConnectionError = ((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Server has closed the connection')) ||
|
|
2711
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Cannot reach database server')) ||
|
|
2712
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('Connection timed out')) ||
|
|
2713
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
2714
|
+
(error.networkError && ((_r = error.networkError.message) === null || _r === void 0 ? void 0 : _r.includes('Failed to fetch')));
|
|
2529
2715
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2530
2716
|
retryCount++;
|
|
2531
2717
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2532
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2718
|
+
logger_1.logger.warn("Database connection error in deleteOneInstitutionalFlowSignal, retrying...", {
|
|
2719
|
+
operation: 'deleteOneInstitutionalFlowSignal',
|
|
2720
|
+
model: 'InstitutionalFlowSignal',
|
|
2721
|
+
attempt: retryCount,
|
|
2722
|
+
maxRetries: MAX_RETRIES,
|
|
2723
|
+
recordId: props.id,
|
|
2724
|
+
});
|
|
2533
2725
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2534
2726
|
continue;
|
|
2535
2727
|
}
|
|
2536
|
-
// Log
|
|
2537
|
-
logger_1.logger.error("Database
|
|
2728
|
+
// Log structured error details and rethrow
|
|
2729
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
2730
|
+
operation: 'deleteOneInstitutionalFlowSignal',
|
|
2731
|
+
model: 'InstitutionalFlowSignal',
|
|
2732
|
+
error: String(error),
|
|
2733
|
+
recordId: props.id,
|
|
2734
|
+
isRetryable: isConnectionError,
|
|
2735
|
+
});
|
|
2538
2736
|
throw error;
|
|
2539
2737
|
}
|
|
2540
2738
|
}
|
|
@@ -2604,12 +2802,22 @@ exports.InstitutionalFlowSignal = {
|
|
|
2604
2802
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2605
2803
|
retryCount++;
|
|
2606
2804
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2607
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2805
|
+
logger_1.logger.warn("Database connection error in getInstitutionalFlowSignal, retrying...", {
|
|
2806
|
+
operation: 'getInstitutionalFlowSignal',
|
|
2807
|
+
model: 'InstitutionalFlowSignal',
|
|
2808
|
+
attempt: retryCount,
|
|
2809
|
+
maxRetries: MAX_RETRIES,
|
|
2810
|
+
});
|
|
2608
2811
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2609
2812
|
continue;
|
|
2610
2813
|
}
|
|
2611
|
-
// Log
|
|
2612
|
-
logger_1.logger.error("Database
|
|
2814
|
+
// Log structured error details and rethrow
|
|
2815
|
+
logger_1.logger.error("Database get operation failed", {
|
|
2816
|
+
operation: 'getInstitutionalFlowSignal',
|
|
2817
|
+
model: 'InstitutionalFlowSignal',
|
|
2818
|
+
error: String(error),
|
|
2819
|
+
isRetryable: isConnectionError,
|
|
2820
|
+
});
|
|
2613
2821
|
throw error;
|
|
2614
2822
|
}
|
|
2615
2823
|
}
|
|
@@ -2667,12 +2875,22 @@ exports.InstitutionalFlowSignal = {
|
|
|
2667
2875
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2668
2876
|
retryCount++;
|
|
2669
2877
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2670
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2878
|
+
logger_1.logger.warn("Database connection error in getAllInstitutionalFlowSignal, retrying...", {
|
|
2879
|
+
operation: 'getAllInstitutionalFlowSignal',
|
|
2880
|
+
model: 'InstitutionalFlowSignal',
|
|
2881
|
+
attempt: retryCount,
|
|
2882
|
+
maxRetries: MAX_RETRIES,
|
|
2883
|
+
});
|
|
2671
2884
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2672
2885
|
continue;
|
|
2673
2886
|
}
|
|
2674
|
-
// Log
|
|
2675
|
-
logger_1.logger.error("Database
|
|
2887
|
+
// Log structured error details and rethrow
|
|
2888
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
2889
|
+
operation: 'getAllInstitutionalFlowSignal',
|
|
2890
|
+
model: 'InstitutionalFlowSignal',
|
|
2891
|
+
error: String(error),
|
|
2892
|
+
isRetryable: isConnectionError,
|
|
2893
|
+
});
|
|
2676
2894
|
throw error;
|
|
2677
2895
|
}
|
|
2678
2896
|
}
|
|
@@ -2749,12 +2967,22 @@ exports.InstitutionalFlowSignal = {
|
|
|
2749
2967
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2750
2968
|
retryCount++;
|
|
2751
2969
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2752
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
2970
|
+
logger_1.logger.warn("Database connection error in findManyInstitutionalFlowSignal, retrying...", {
|
|
2971
|
+
operation: 'findManyInstitutionalFlowSignal',
|
|
2972
|
+
model: 'InstitutionalFlowSignal',
|
|
2973
|
+
attempt: retryCount,
|
|
2974
|
+
maxRetries: MAX_RETRIES,
|
|
2975
|
+
});
|
|
2753
2976
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2754
2977
|
continue;
|
|
2755
2978
|
}
|
|
2756
|
-
// Log
|
|
2757
|
-
logger_1.logger.error("Database
|
|
2979
|
+
// Log structured error details and rethrow
|
|
2980
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
2981
|
+
operation: 'findManyInstitutionalFlowSignal',
|
|
2982
|
+
model: 'InstitutionalFlowSignal',
|
|
2983
|
+
error: String(error),
|
|
2984
|
+
isRetryable: isConnectionError,
|
|
2985
|
+
});
|
|
2758
2986
|
throw error;
|
|
2759
2987
|
}
|
|
2760
2988
|
}
|