@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
|
@@ -35,7 +35,7 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
35
35
|
* @returns The created InstitutionalSentimentMetrics or null.
|
|
36
36
|
*/
|
|
37
37
|
async create(props, globalClient) {
|
|
38
|
-
var _a, _b, _c, _d, _e;
|
|
38
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
39
39
|
// Maximum number of retries for database connection issues
|
|
40
40
|
const MAX_RETRIES = 3;
|
|
41
41
|
let retryCount = 0;
|
|
@@ -86,21 +86,52 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
86
86
|
}
|
|
87
87
|
catch (error) {
|
|
88
88
|
lastError = error;
|
|
89
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
90
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
91
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
92
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
93
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
94
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
95
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
96
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
97
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
98
|
+
if (isConstraintViolation) {
|
|
99
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
100
|
+
logger_1.logger.error("Non-retryable constraint violation in createOneInstitutionalSentimentMetrics", {
|
|
101
|
+
operation: 'createOneInstitutionalSentimentMetrics',
|
|
102
|
+
model: 'InstitutionalSentimentMetrics',
|
|
103
|
+
error: String(error),
|
|
104
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
105
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
106
|
+
isRetryable: false,
|
|
107
|
+
});
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
89
110
|
// Check if this is a database connection error that we should retry
|
|
90
|
-
const isConnectionError = ((
|
|
91
|
-
((
|
|
92
|
-
((
|
|
93
|
-
((
|
|
94
|
-
(error.networkError && ((
|
|
111
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
112
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
113
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
114
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
115
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
95
116
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
96
117
|
retryCount++;
|
|
97
118
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
98
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
119
|
+
logger_1.logger.warn("Database connection error in createOneInstitutionalSentimentMetrics, retrying...", {
|
|
120
|
+
operation: 'createOneInstitutionalSentimentMetrics',
|
|
121
|
+
model: 'InstitutionalSentimentMetrics',
|
|
122
|
+
attempt: retryCount,
|
|
123
|
+
maxRetries: MAX_RETRIES,
|
|
124
|
+
});
|
|
99
125
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
100
126
|
continue;
|
|
101
127
|
}
|
|
102
|
-
// Log
|
|
103
|
-
logger_1.logger.error("Database
|
|
128
|
+
// Log structured error details and rethrow
|
|
129
|
+
logger_1.logger.error("Database create operation failed", {
|
|
130
|
+
operation: 'createOneInstitutionalSentimentMetrics',
|
|
131
|
+
model: 'InstitutionalSentimentMetrics',
|
|
132
|
+
error: String(error),
|
|
133
|
+
isRetryable: isConnectionError,
|
|
134
|
+
});
|
|
104
135
|
throw error;
|
|
105
136
|
}
|
|
106
137
|
}
|
|
@@ -115,7 +146,7 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
115
146
|
* @returns The count of created records or null.
|
|
116
147
|
*/
|
|
117
148
|
async createMany(props, globalClient) {
|
|
118
|
-
var _a, _b, _c, _d, _e;
|
|
149
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
119
150
|
// Maximum number of retries for database connection issues
|
|
120
151
|
const MAX_RETRIES = 3;
|
|
121
152
|
let retryCount = 0;
|
|
@@ -165,21 +196,52 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
165
196
|
}
|
|
166
197
|
catch (error) {
|
|
167
198
|
lastError = error;
|
|
199
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
200
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
201
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
202
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
203
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
204
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
205
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
206
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
207
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
208
|
+
if (isConstraintViolation) {
|
|
209
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
210
|
+
logger_1.logger.error("Non-retryable constraint violation in createManyInstitutionalSentimentMetrics", {
|
|
211
|
+
operation: 'createManyInstitutionalSentimentMetrics',
|
|
212
|
+
model: 'InstitutionalSentimentMetrics',
|
|
213
|
+
error: String(error),
|
|
214
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
215
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
216
|
+
isRetryable: false,
|
|
217
|
+
});
|
|
218
|
+
throw error;
|
|
219
|
+
}
|
|
168
220
|
// Check if this is a database connection error that we should retry
|
|
169
|
-
const isConnectionError = ((
|
|
170
|
-
((
|
|
171
|
-
((
|
|
172
|
-
((
|
|
173
|
-
(error.networkError && ((
|
|
221
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
222
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
223
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
224
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
225
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
174
226
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
175
227
|
retryCount++;
|
|
176
228
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
177
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
229
|
+
logger_1.logger.warn("Database connection error in createManyInstitutionalSentimentMetrics, retrying...", {
|
|
230
|
+
operation: 'createManyInstitutionalSentimentMetrics',
|
|
231
|
+
model: 'InstitutionalSentimentMetrics',
|
|
232
|
+
attempt: retryCount,
|
|
233
|
+
maxRetries: MAX_RETRIES,
|
|
234
|
+
});
|
|
178
235
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
179
236
|
continue;
|
|
180
237
|
}
|
|
181
|
-
// Log
|
|
182
|
-
logger_1.logger.error("Database
|
|
238
|
+
// Log structured error details and rethrow
|
|
239
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
240
|
+
operation: 'createManyInstitutionalSentimentMetrics',
|
|
241
|
+
model: 'InstitutionalSentimentMetrics',
|
|
242
|
+
error: String(error),
|
|
243
|
+
isRetryable: isConnectionError,
|
|
244
|
+
});
|
|
183
245
|
throw error;
|
|
184
246
|
}
|
|
185
247
|
}
|
|
@@ -194,7 +256,7 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
194
256
|
* @returns The updated InstitutionalSentimentMetrics or null.
|
|
195
257
|
*/
|
|
196
258
|
async update(props, globalClient) {
|
|
197
|
-
var _a, _b, _c, _d, _e;
|
|
259
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
198
260
|
// Maximum number of retries for database connection issues
|
|
199
261
|
const MAX_RETRIES = 3;
|
|
200
262
|
let retryCount = 0;
|
|
@@ -267,21 +329,55 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
267
329
|
}
|
|
268
330
|
catch (error) {
|
|
269
331
|
lastError = error;
|
|
332
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
333
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
334
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
335
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
336
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
337
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
338
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
339
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
340
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
341
|
+
if (isConstraintViolation) {
|
|
342
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
343
|
+
logger_1.logger.error("Non-retryable constraint violation in updateOneInstitutionalSentimentMetrics", {
|
|
344
|
+
operation: 'updateOneInstitutionalSentimentMetrics',
|
|
345
|
+
model: 'InstitutionalSentimentMetrics',
|
|
346
|
+
error: String(error),
|
|
347
|
+
recordId: props.id,
|
|
348
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
349
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
350
|
+
isRetryable: false,
|
|
351
|
+
});
|
|
352
|
+
throw error;
|
|
353
|
+
}
|
|
270
354
|
// Check if this is a database connection error that we should retry
|
|
271
|
-
const isConnectionError = ((
|
|
272
|
-
((
|
|
273
|
-
((
|
|
274
|
-
((
|
|
275
|
-
(error.networkError && ((
|
|
355
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
356
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
357
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
358
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
359
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
276
360
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
277
361
|
retryCount++;
|
|
278
362
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
279
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
363
|
+
logger_1.logger.warn("Database connection error in updateOneInstitutionalSentimentMetrics, retrying...", {
|
|
364
|
+
operation: 'updateOneInstitutionalSentimentMetrics',
|
|
365
|
+
model: 'InstitutionalSentimentMetrics',
|
|
366
|
+
attempt: retryCount,
|
|
367
|
+
maxRetries: MAX_RETRIES,
|
|
368
|
+
recordId: props.id,
|
|
369
|
+
});
|
|
280
370
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
281
371
|
continue;
|
|
282
372
|
}
|
|
283
|
-
// Log
|
|
284
|
-
logger_1.logger.error("Database
|
|
373
|
+
// Log structured error details and rethrow
|
|
374
|
+
logger_1.logger.error("Database update operation failed", {
|
|
375
|
+
operation: 'updateOneInstitutionalSentimentMetrics',
|
|
376
|
+
model: 'InstitutionalSentimentMetrics',
|
|
377
|
+
error: String(error),
|
|
378
|
+
recordId: props.id,
|
|
379
|
+
isRetryable: isConnectionError,
|
|
380
|
+
});
|
|
285
381
|
throw error;
|
|
286
382
|
}
|
|
287
383
|
}
|
|
@@ -296,7 +392,7 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
296
392
|
* @returns The updated InstitutionalSentimentMetrics or null.
|
|
297
393
|
*/
|
|
298
394
|
async upsert(props, globalClient) {
|
|
299
|
-
var _a, _b, _c, _d, _e;
|
|
395
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
300
396
|
// Maximum number of retries for database connection issues
|
|
301
397
|
const MAX_RETRIES = 3;
|
|
302
398
|
let retryCount = 0;
|
|
@@ -372,21 +468,55 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
372
468
|
}
|
|
373
469
|
catch (error) {
|
|
374
470
|
lastError = error;
|
|
471
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
472
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
473
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
474
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
475
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
476
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
477
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
478
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
479
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
480
|
+
if (isConstraintViolation) {
|
|
481
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
482
|
+
logger_1.logger.error("Non-retryable constraint violation in upsertOneInstitutionalSentimentMetrics", {
|
|
483
|
+
operation: 'upsertOneInstitutionalSentimentMetrics',
|
|
484
|
+
model: 'InstitutionalSentimentMetrics',
|
|
485
|
+
error: String(error),
|
|
486
|
+
recordId: props.id,
|
|
487
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
488
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
489
|
+
isRetryable: false,
|
|
490
|
+
});
|
|
491
|
+
throw error;
|
|
492
|
+
}
|
|
375
493
|
// Check if this is a database connection error that we should retry
|
|
376
|
-
const isConnectionError = ((
|
|
377
|
-
((
|
|
378
|
-
((
|
|
379
|
-
((
|
|
380
|
-
(error.networkError && ((
|
|
494
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
495
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
496
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
497
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
498
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
381
499
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
382
500
|
retryCount++;
|
|
383
501
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
384
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
502
|
+
logger_1.logger.warn("Database connection error in upsertOneInstitutionalSentimentMetrics, retrying...", {
|
|
503
|
+
operation: 'upsertOneInstitutionalSentimentMetrics',
|
|
504
|
+
model: 'InstitutionalSentimentMetrics',
|
|
505
|
+
attempt: retryCount,
|
|
506
|
+
maxRetries: MAX_RETRIES,
|
|
507
|
+
recordId: props.id,
|
|
508
|
+
});
|
|
385
509
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
386
510
|
continue;
|
|
387
511
|
}
|
|
388
|
-
// Log
|
|
389
|
-
logger_1.logger.error("Database
|
|
512
|
+
// Log structured error details and rethrow
|
|
513
|
+
logger_1.logger.error("Database upsert operation failed", {
|
|
514
|
+
operation: 'upsertOneInstitutionalSentimentMetrics',
|
|
515
|
+
model: 'InstitutionalSentimentMetrics',
|
|
516
|
+
error: String(error),
|
|
517
|
+
recordId: props.id,
|
|
518
|
+
isRetryable: isConnectionError,
|
|
519
|
+
});
|
|
390
520
|
throw error;
|
|
391
521
|
}
|
|
392
522
|
}
|
|
@@ -401,7 +531,7 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
401
531
|
* @returns The count of created records or null.
|
|
402
532
|
*/
|
|
403
533
|
async updateMany(props, globalClient) {
|
|
404
|
-
var _a, _b, _c, _d, _e;
|
|
534
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
405
535
|
// Maximum number of retries for database connection issues
|
|
406
536
|
const MAX_RETRIES = 3;
|
|
407
537
|
let retryCount = 0;
|
|
@@ -474,21 +604,52 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
474
604
|
}
|
|
475
605
|
catch (error) {
|
|
476
606
|
lastError = error;
|
|
607
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
608
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
609
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
610
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
611
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
612
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
613
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
614
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
615
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
616
|
+
if (isConstraintViolation) {
|
|
617
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
618
|
+
logger_1.logger.error("Non-retryable constraint violation in updateManyInstitutionalSentimentMetrics", {
|
|
619
|
+
operation: 'updateManyInstitutionalSentimentMetrics',
|
|
620
|
+
model: 'InstitutionalSentimentMetrics',
|
|
621
|
+
error: String(error),
|
|
622
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
623
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
624
|
+
isRetryable: false,
|
|
625
|
+
});
|
|
626
|
+
throw error;
|
|
627
|
+
}
|
|
477
628
|
// Check if this is a database connection error that we should retry
|
|
478
|
-
const isConnectionError = ((
|
|
479
|
-
((
|
|
480
|
-
((
|
|
481
|
-
((
|
|
482
|
-
(error.networkError && ((
|
|
629
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
630
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
631
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
632
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
633
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
483
634
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
484
635
|
retryCount++;
|
|
485
636
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
486
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
637
|
+
logger_1.logger.warn("Database connection error in updateManyInstitutionalSentimentMetrics, retrying...", {
|
|
638
|
+
operation: 'updateManyInstitutionalSentimentMetrics',
|
|
639
|
+
model: 'InstitutionalSentimentMetrics',
|
|
640
|
+
attempt: retryCount,
|
|
641
|
+
maxRetries: MAX_RETRIES,
|
|
642
|
+
});
|
|
487
643
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
488
644
|
continue;
|
|
489
645
|
}
|
|
490
|
-
// Log
|
|
491
|
-
logger_1.logger.error("Database
|
|
646
|
+
// Log structured error details and rethrow
|
|
647
|
+
logger_1.logger.error("Database updateMany operation failed", {
|
|
648
|
+
operation: 'updateManyInstitutionalSentimentMetrics',
|
|
649
|
+
model: 'InstitutionalSentimentMetrics',
|
|
650
|
+
error: String(error),
|
|
651
|
+
isRetryable: isConnectionError,
|
|
652
|
+
});
|
|
492
653
|
throw error;
|
|
493
654
|
}
|
|
494
655
|
}
|
|
@@ -503,7 +664,7 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
503
664
|
* @returns The deleted InstitutionalSentimentMetrics or null.
|
|
504
665
|
*/
|
|
505
666
|
async delete(props, globalClient) {
|
|
506
|
-
var _a, _b, _c, _d, _e;
|
|
667
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
507
668
|
// Maximum number of retries for database connection issues
|
|
508
669
|
const MAX_RETRIES = 3;
|
|
509
670
|
let retryCount = 0;
|
|
@@ -547,21 +708,58 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
547
708
|
}
|
|
548
709
|
catch (error) {
|
|
549
710
|
lastError = error;
|
|
711
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
712
|
+
// (e.g., foreign key constraints preventing deletion)
|
|
713
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
714
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
715
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
716
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
717
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
718
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
719
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('23503')) ||
|
|
720
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2002')) ||
|
|
721
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('P2003')) ||
|
|
722
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('P2014'));
|
|
723
|
+
if (isConstraintViolation) {
|
|
724
|
+
const constraintMatch = (_l = error.message) === null || _l === void 0 ? void 0 : _l.match(/constraint\s+"([^"]+)"/);
|
|
725
|
+
logger_1.logger.error("Non-retryable constraint violation in deleteOneInstitutionalSentimentMetrics", {
|
|
726
|
+
operation: 'deleteOneInstitutionalSentimentMetrics',
|
|
727
|
+
model: 'InstitutionalSentimentMetrics',
|
|
728
|
+
error: String(error),
|
|
729
|
+
recordId: props.id,
|
|
730
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
731
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
732
|
+
isRetryable: false,
|
|
733
|
+
});
|
|
734
|
+
throw error;
|
|
735
|
+
}
|
|
550
736
|
// Check if this is a database connection error that we should retry
|
|
551
|
-
const isConnectionError = ((
|
|
552
|
-
((
|
|
553
|
-
((
|
|
554
|
-
((
|
|
555
|
-
(error.networkError && ((
|
|
737
|
+
const isConnectionError = ((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Server has closed the connection')) ||
|
|
738
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Cannot reach database server')) ||
|
|
739
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('Connection timed out')) ||
|
|
740
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
741
|
+
(error.networkError && ((_r = error.networkError.message) === null || _r === void 0 ? void 0 : _r.includes('Failed to fetch')));
|
|
556
742
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
557
743
|
retryCount++;
|
|
558
744
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
559
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
745
|
+
logger_1.logger.warn("Database connection error in deleteOneInstitutionalSentimentMetrics, retrying...", {
|
|
746
|
+
operation: 'deleteOneInstitutionalSentimentMetrics',
|
|
747
|
+
model: 'InstitutionalSentimentMetrics',
|
|
748
|
+
attempt: retryCount,
|
|
749
|
+
maxRetries: MAX_RETRIES,
|
|
750
|
+
recordId: props.id,
|
|
751
|
+
});
|
|
560
752
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
561
753
|
continue;
|
|
562
754
|
}
|
|
563
|
-
// Log
|
|
564
|
-
logger_1.logger.error("Database
|
|
755
|
+
// Log structured error details and rethrow
|
|
756
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
757
|
+
operation: 'deleteOneInstitutionalSentimentMetrics',
|
|
758
|
+
model: 'InstitutionalSentimentMetrics',
|
|
759
|
+
error: String(error),
|
|
760
|
+
recordId: props.id,
|
|
761
|
+
isRetryable: isConnectionError,
|
|
762
|
+
});
|
|
565
763
|
throw error;
|
|
566
764
|
}
|
|
567
765
|
}
|
|
@@ -628,12 +826,22 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
628
826
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
629
827
|
retryCount++;
|
|
630
828
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
631
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
829
|
+
logger_1.logger.warn("Database connection error in getInstitutionalSentimentMetrics, retrying...", {
|
|
830
|
+
operation: 'getInstitutionalSentimentMetrics',
|
|
831
|
+
model: 'InstitutionalSentimentMetrics',
|
|
832
|
+
attempt: retryCount,
|
|
833
|
+
maxRetries: MAX_RETRIES,
|
|
834
|
+
});
|
|
632
835
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
633
836
|
continue;
|
|
634
837
|
}
|
|
635
|
-
// Log
|
|
636
|
-
logger_1.logger.error("Database
|
|
838
|
+
// Log structured error details and rethrow
|
|
839
|
+
logger_1.logger.error("Database get operation failed", {
|
|
840
|
+
operation: 'getInstitutionalSentimentMetrics',
|
|
841
|
+
model: 'InstitutionalSentimentMetrics',
|
|
842
|
+
error: String(error),
|
|
843
|
+
isRetryable: isConnectionError,
|
|
844
|
+
});
|
|
637
845
|
throw error;
|
|
638
846
|
}
|
|
639
847
|
}
|
|
@@ -691,12 +899,22 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
691
899
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
692
900
|
retryCount++;
|
|
693
901
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
694
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
902
|
+
logger_1.logger.warn("Database connection error in getAllInstitutionalSentimentMetrics, retrying...", {
|
|
903
|
+
operation: 'getAllInstitutionalSentimentMetrics',
|
|
904
|
+
model: 'InstitutionalSentimentMetrics',
|
|
905
|
+
attempt: retryCount,
|
|
906
|
+
maxRetries: MAX_RETRIES,
|
|
907
|
+
});
|
|
695
908
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
696
909
|
continue;
|
|
697
910
|
}
|
|
698
|
-
// Log
|
|
699
|
-
logger_1.logger.error("Database
|
|
911
|
+
// Log structured error details and rethrow
|
|
912
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
913
|
+
operation: 'getAllInstitutionalSentimentMetrics',
|
|
914
|
+
model: 'InstitutionalSentimentMetrics',
|
|
915
|
+
error: String(error),
|
|
916
|
+
isRetryable: isConnectionError,
|
|
917
|
+
});
|
|
700
918
|
throw error;
|
|
701
919
|
}
|
|
702
920
|
}
|
|
@@ -770,12 +988,22 @@ exports.InstitutionalSentimentMetrics = {
|
|
|
770
988
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
771
989
|
retryCount++;
|
|
772
990
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
773
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
991
|
+
logger_1.logger.warn("Database connection error in findManyInstitutionalSentimentMetrics, retrying...", {
|
|
992
|
+
operation: 'findManyInstitutionalSentimentMetrics',
|
|
993
|
+
model: 'InstitutionalSentimentMetrics',
|
|
994
|
+
attempt: retryCount,
|
|
995
|
+
maxRetries: MAX_RETRIES,
|
|
996
|
+
});
|
|
774
997
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
775
998
|
continue;
|
|
776
999
|
}
|
|
777
|
-
// Log
|
|
778
|
-
logger_1.logger.error("Database
|
|
1000
|
+
// Log structured error details and rethrow
|
|
1001
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
1002
|
+
operation: 'findManyInstitutionalSentimentMetrics',
|
|
1003
|
+
model: 'InstitutionalSentimentMetrics',
|
|
1004
|
+
error: String(error),
|
|
1005
|
+
isRetryable: isConnectionError,
|
|
1006
|
+
});
|
|
779
1007
|
throw error;
|
|
780
1008
|
}
|
|
781
1009
|
}
|