@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
|
@@ -38,7 +38,7 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
38
38
|
* @returns The created InstitutionalSentimentAlerts or null.
|
|
39
39
|
*/
|
|
40
40
|
async create(props, globalClient) {
|
|
41
|
-
var _a, _b, _c, _d, _e;
|
|
41
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
42
42
|
// Maximum number of retries for database connection issues
|
|
43
43
|
const MAX_RETRIES = 3;
|
|
44
44
|
let retryCount = 0;
|
|
@@ -91,21 +91,52 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
91
91
|
}
|
|
92
92
|
catch (error) {
|
|
93
93
|
lastError = error;
|
|
94
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
95
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
96
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
97
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
98
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
99
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
100
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
101
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
102
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
103
|
+
if (isConstraintViolation) {
|
|
104
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
105
|
+
logger_1.logger.error("Non-retryable constraint violation in createOneInstitutionalSentimentAlerts", {
|
|
106
|
+
operation: 'createOneInstitutionalSentimentAlerts',
|
|
107
|
+
model: 'InstitutionalSentimentAlerts',
|
|
108
|
+
error: String(error),
|
|
109
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
110
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
111
|
+
isRetryable: false,
|
|
112
|
+
});
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
94
115
|
// Check if this is a database connection error that we should retry
|
|
95
|
-
const isConnectionError = ((
|
|
96
|
-
((
|
|
97
|
-
((
|
|
98
|
-
((
|
|
99
|
-
(error.networkError && ((
|
|
116
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
117
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
118
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
119
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
120
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
100
121
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
101
122
|
retryCount++;
|
|
102
123
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
103
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
124
|
+
logger_1.logger.warn("Database connection error in createOneInstitutionalSentimentAlerts, retrying...", {
|
|
125
|
+
operation: 'createOneInstitutionalSentimentAlerts',
|
|
126
|
+
model: 'InstitutionalSentimentAlerts',
|
|
127
|
+
attempt: retryCount,
|
|
128
|
+
maxRetries: MAX_RETRIES,
|
|
129
|
+
});
|
|
104
130
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
105
131
|
continue;
|
|
106
132
|
}
|
|
107
|
-
// Log
|
|
108
|
-
logger_1.logger.error("Database
|
|
133
|
+
// Log structured error details and rethrow
|
|
134
|
+
logger_1.logger.error("Database create operation failed", {
|
|
135
|
+
operation: 'createOneInstitutionalSentimentAlerts',
|
|
136
|
+
model: 'InstitutionalSentimentAlerts',
|
|
137
|
+
error: String(error),
|
|
138
|
+
isRetryable: isConnectionError,
|
|
139
|
+
});
|
|
109
140
|
throw error;
|
|
110
141
|
}
|
|
111
142
|
}
|
|
@@ -120,7 +151,7 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
120
151
|
* @returns The count of created records or null.
|
|
121
152
|
*/
|
|
122
153
|
async createMany(props, globalClient) {
|
|
123
|
-
var _a, _b, _c, _d, _e;
|
|
154
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
124
155
|
// Maximum number of retries for database connection issues
|
|
125
156
|
const MAX_RETRIES = 3;
|
|
126
157
|
let retryCount = 0;
|
|
@@ -172,21 +203,52 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
172
203
|
}
|
|
173
204
|
catch (error) {
|
|
174
205
|
lastError = error;
|
|
206
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
207
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
208
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
209
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
210
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
211
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
212
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
213
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
214
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
215
|
+
if (isConstraintViolation) {
|
|
216
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
217
|
+
logger_1.logger.error("Non-retryable constraint violation in createManyInstitutionalSentimentAlerts", {
|
|
218
|
+
operation: 'createManyInstitutionalSentimentAlerts',
|
|
219
|
+
model: 'InstitutionalSentimentAlerts',
|
|
220
|
+
error: String(error),
|
|
221
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
222
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
223
|
+
isRetryable: false,
|
|
224
|
+
});
|
|
225
|
+
throw error;
|
|
226
|
+
}
|
|
175
227
|
// Check if this is a database connection error that we should retry
|
|
176
|
-
const isConnectionError = ((
|
|
177
|
-
((
|
|
178
|
-
((
|
|
179
|
-
((
|
|
180
|
-
(error.networkError && ((
|
|
228
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
229
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
230
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
231
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
232
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
181
233
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
182
234
|
retryCount++;
|
|
183
235
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
184
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
236
|
+
logger_1.logger.warn("Database connection error in createManyInstitutionalSentimentAlerts, retrying...", {
|
|
237
|
+
operation: 'createManyInstitutionalSentimentAlerts',
|
|
238
|
+
model: 'InstitutionalSentimentAlerts',
|
|
239
|
+
attempt: retryCount,
|
|
240
|
+
maxRetries: MAX_RETRIES,
|
|
241
|
+
});
|
|
185
242
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
186
243
|
continue;
|
|
187
244
|
}
|
|
188
|
-
// Log
|
|
189
|
-
logger_1.logger.error("Database
|
|
245
|
+
// Log structured error details and rethrow
|
|
246
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
247
|
+
operation: 'createManyInstitutionalSentimentAlerts',
|
|
248
|
+
model: 'InstitutionalSentimentAlerts',
|
|
249
|
+
error: String(error),
|
|
250
|
+
isRetryable: isConnectionError,
|
|
251
|
+
});
|
|
190
252
|
throw error;
|
|
191
253
|
}
|
|
192
254
|
}
|
|
@@ -201,7 +263,7 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
201
263
|
* @returns The updated InstitutionalSentimentAlerts or null.
|
|
202
264
|
*/
|
|
203
265
|
async update(props, globalClient) {
|
|
204
|
-
var _a, _b, _c, _d, _e;
|
|
266
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
205
267
|
// Maximum number of retries for database connection issues
|
|
206
268
|
const MAX_RETRIES = 3;
|
|
207
269
|
let retryCount = 0;
|
|
@@ -283,21 +345,55 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
283
345
|
}
|
|
284
346
|
catch (error) {
|
|
285
347
|
lastError = error;
|
|
348
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
349
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
350
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
351
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
352
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
353
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
354
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
355
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
356
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
357
|
+
if (isConstraintViolation) {
|
|
358
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
359
|
+
logger_1.logger.error("Non-retryable constraint violation in updateOneInstitutionalSentimentAlerts", {
|
|
360
|
+
operation: 'updateOneInstitutionalSentimentAlerts',
|
|
361
|
+
model: 'InstitutionalSentimentAlerts',
|
|
362
|
+
error: String(error),
|
|
363
|
+
recordId: props.id,
|
|
364
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
365
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
366
|
+
isRetryable: false,
|
|
367
|
+
});
|
|
368
|
+
throw error;
|
|
369
|
+
}
|
|
286
370
|
// Check if this is a database connection error that we should retry
|
|
287
|
-
const isConnectionError = ((
|
|
288
|
-
((
|
|
289
|
-
((
|
|
290
|
-
((
|
|
291
|
-
(error.networkError && ((
|
|
371
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
372
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
373
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
374
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
375
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
292
376
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
293
377
|
retryCount++;
|
|
294
378
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
295
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
379
|
+
logger_1.logger.warn("Database connection error in updateOneInstitutionalSentimentAlerts, retrying...", {
|
|
380
|
+
operation: 'updateOneInstitutionalSentimentAlerts',
|
|
381
|
+
model: 'InstitutionalSentimentAlerts',
|
|
382
|
+
attempt: retryCount,
|
|
383
|
+
maxRetries: MAX_RETRIES,
|
|
384
|
+
recordId: props.id,
|
|
385
|
+
});
|
|
296
386
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
297
387
|
continue;
|
|
298
388
|
}
|
|
299
|
-
// Log
|
|
300
|
-
logger_1.logger.error("Database
|
|
389
|
+
// Log structured error details and rethrow
|
|
390
|
+
logger_1.logger.error("Database update operation failed", {
|
|
391
|
+
operation: 'updateOneInstitutionalSentimentAlerts',
|
|
392
|
+
model: 'InstitutionalSentimentAlerts',
|
|
393
|
+
error: String(error),
|
|
394
|
+
recordId: props.id,
|
|
395
|
+
isRetryable: isConnectionError,
|
|
396
|
+
});
|
|
301
397
|
throw error;
|
|
302
398
|
}
|
|
303
399
|
}
|
|
@@ -312,7 +408,7 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
312
408
|
* @returns The updated InstitutionalSentimentAlerts or null.
|
|
313
409
|
*/
|
|
314
410
|
async upsert(props, globalClient) {
|
|
315
|
-
var _a, _b, _c, _d, _e;
|
|
411
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
316
412
|
// Maximum number of retries for database connection issues
|
|
317
413
|
const MAX_RETRIES = 3;
|
|
318
414
|
let retryCount = 0;
|
|
@@ -396,21 +492,55 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
396
492
|
}
|
|
397
493
|
catch (error) {
|
|
398
494
|
lastError = error;
|
|
495
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
496
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
497
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
498
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
499
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
500
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
501
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
502
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
503
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
504
|
+
if (isConstraintViolation) {
|
|
505
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
506
|
+
logger_1.logger.error("Non-retryable constraint violation in upsertOneInstitutionalSentimentAlerts", {
|
|
507
|
+
operation: 'upsertOneInstitutionalSentimentAlerts',
|
|
508
|
+
model: 'InstitutionalSentimentAlerts',
|
|
509
|
+
error: String(error),
|
|
510
|
+
recordId: props.id,
|
|
511
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
512
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
513
|
+
isRetryable: false,
|
|
514
|
+
});
|
|
515
|
+
throw error;
|
|
516
|
+
}
|
|
399
517
|
// Check if this is a database connection error that we should retry
|
|
400
|
-
const isConnectionError = ((
|
|
401
|
-
((
|
|
402
|
-
((
|
|
403
|
-
((
|
|
404
|
-
(error.networkError && ((
|
|
518
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
519
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
520
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
521
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
522
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
405
523
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
406
524
|
retryCount++;
|
|
407
525
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
408
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
526
|
+
logger_1.logger.warn("Database connection error in upsertOneInstitutionalSentimentAlerts, retrying...", {
|
|
527
|
+
operation: 'upsertOneInstitutionalSentimentAlerts',
|
|
528
|
+
model: 'InstitutionalSentimentAlerts',
|
|
529
|
+
attempt: retryCount,
|
|
530
|
+
maxRetries: MAX_RETRIES,
|
|
531
|
+
recordId: props.id,
|
|
532
|
+
});
|
|
409
533
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
410
534
|
continue;
|
|
411
535
|
}
|
|
412
|
-
// Log
|
|
413
|
-
logger_1.logger.error("Database
|
|
536
|
+
// Log structured error details and rethrow
|
|
537
|
+
logger_1.logger.error("Database upsert operation failed", {
|
|
538
|
+
operation: 'upsertOneInstitutionalSentimentAlerts',
|
|
539
|
+
model: 'InstitutionalSentimentAlerts',
|
|
540
|
+
error: String(error),
|
|
541
|
+
recordId: props.id,
|
|
542
|
+
isRetryable: isConnectionError,
|
|
543
|
+
});
|
|
414
544
|
throw error;
|
|
415
545
|
}
|
|
416
546
|
}
|
|
@@ -425,7 +555,7 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
425
555
|
* @returns The count of created records or null.
|
|
426
556
|
*/
|
|
427
557
|
async updateMany(props, globalClient) {
|
|
428
|
-
var _a, _b, _c, _d, _e;
|
|
558
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
429
559
|
// Maximum number of retries for database connection issues
|
|
430
560
|
const MAX_RETRIES = 3;
|
|
431
561
|
let retryCount = 0;
|
|
@@ -507,21 +637,52 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
507
637
|
}
|
|
508
638
|
catch (error) {
|
|
509
639
|
lastError = error;
|
|
640
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
641
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
642
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
643
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
644
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
645
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
646
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
647
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
648
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
649
|
+
if (isConstraintViolation) {
|
|
650
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
651
|
+
logger_1.logger.error("Non-retryable constraint violation in updateManyInstitutionalSentimentAlerts", {
|
|
652
|
+
operation: 'updateManyInstitutionalSentimentAlerts',
|
|
653
|
+
model: 'InstitutionalSentimentAlerts',
|
|
654
|
+
error: String(error),
|
|
655
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
656
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
657
|
+
isRetryable: false,
|
|
658
|
+
});
|
|
659
|
+
throw error;
|
|
660
|
+
}
|
|
510
661
|
// Check if this is a database connection error that we should retry
|
|
511
|
-
const isConnectionError = ((
|
|
512
|
-
((
|
|
513
|
-
((
|
|
514
|
-
((
|
|
515
|
-
(error.networkError && ((
|
|
662
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
663
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
664
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
665
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
666
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
516
667
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
517
668
|
retryCount++;
|
|
518
669
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
519
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
670
|
+
logger_1.logger.warn("Database connection error in updateManyInstitutionalSentimentAlerts, retrying...", {
|
|
671
|
+
operation: 'updateManyInstitutionalSentimentAlerts',
|
|
672
|
+
model: 'InstitutionalSentimentAlerts',
|
|
673
|
+
attempt: retryCount,
|
|
674
|
+
maxRetries: MAX_RETRIES,
|
|
675
|
+
});
|
|
520
676
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
521
677
|
continue;
|
|
522
678
|
}
|
|
523
|
-
// Log
|
|
524
|
-
logger_1.logger.error("Database
|
|
679
|
+
// Log structured error details and rethrow
|
|
680
|
+
logger_1.logger.error("Database updateMany operation failed", {
|
|
681
|
+
operation: 'updateManyInstitutionalSentimentAlerts',
|
|
682
|
+
model: 'InstitutionalSentimentAlerts',
|
|
683
|
+
error: String(error),
|
|
684
|
+
isRetryable: isConnectionError,
|
|
685
|
+
});
|
|
525
686
|
throw error;
|
|
526
687
|
}
|
|
527
688
|
}
|
|
@@ -536,7 +697,7 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
536
697
|
* @returns The deleted InstitutionalSentimentAlerts or null.
|
|
537
698
|
*/
|
|
538
699
|
async delete(props, globalClient) {
|
|
539
|
-
var _a, _b, _c, _d, _e;
|
|
700
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
540
701
|
// Maximum number of retries for database connection issues
|
|
541
702
|
const MAX_RETRIES = 3;
|
|
542
703
|
let retryCount = 0;
|
|
@@ -580,21 +741,58 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
580
741
|
}
|
|
581
742
|
catch (error) {
|
|
582
743
|
lastError = error;
|
|
744
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
745
|
+
// (e.g., foreign key constraints preventing deletion)
|
|
746
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
747
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
748
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
749
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
750
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
751
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
752
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('23503')) ||
|
|
753
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2002')) ||
|
|
754
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('P2003')) ||
|
|
755
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('P2014'));
|
|
756
|
+
if (isConstraintViolation) {
|
|
757
|
+
const constraintMatch = (_l = error.message) === null || _l === void 0 ? void 0 : _l.match(/constraint\s+"([^"]+)"/);
|
|
758
|
+
logger_1.logger.error("Non-retryable constraint violation in deleteOneInstitutionalSentimentAlerts", {
|
|
759
|
+
operation: 'deleteOneInstitutionalSentimentAlerts',
|
|
760
|
+
model: 'InstitutionalSentimentAlerts',
|
|
761
|
+
error: String(error),
|
|
762
|
+
recordId: props.id,
|
|
763
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
764
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
765
|
+
isRetryable: false,
|
|
766
|
+
});
|
|
767
|
+
throw error;
|
|
768
|
+
}
|
|
583
769
|
// Check if this is a database connection error that we should retry
|
|
584
|
-
const isConnectionError = ((
|
|
585
|
-
((
|
|
586
|
-
((
|
|
587
|
-
((
|
|
588
|
-
(error.networkError && ((
|
|
770
|
+
const isConnectionError = ((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Server has closed the connection')) ||
|
|
771
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Cannot reach database server')) ||
|
|
772
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('Connection timed out')) ||
|
|
773
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
774
|
+
(error.networkError && ((_r = error.networkError.message) === null || _r === void 0 ? void 0 : _r.includes('Failed to fetch')));
|
|
589
775
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
590
776
|
retryCount++;
|
|
591
777
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
592
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
778
|
+
logger_1.logger.warn("Database connection error in deleteOneInstitutionalSentimentAlerts, retrying...", {
|
|
779
|
+
operation: 'deleteOneInstitutionalSentimentAlerts',
|
|
780
|
+
model: 'InstitutionalSentimentAlerts',
|
|
781
|
+
attempt: retryCount,
|
|
782
|
+
maxRetries: MAX_RETRIES,
|
|
783
|
+
recordId: props.id,
|
|
784
|
+
});
|
|
593
785
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
594
786
|
continue;
|
|
595
787
|
}
|
|
596
|
-
// Log
|
|
597
|
-
logger_1.logger.error("Database
|
|
788
|
+
// Log structured error details and rethrow
|
|
789
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
790
|
+
operation: 'deleteOneInstitutionalSentimentAlerts',
|
|
791
|
+
model: 'InstitutionalSentimentAlerts',
|
|
792
|
+
error: String(error),
|
|
793
|
+
recordId: props.id,
|
|
794
|
+
isRetryable: isConnectionError,
|
|
795
|
+
});
|
|
598
796
|
throw error;
|
|
599
797
|
}
|
|
600
798
|
}
|
|
@@ -661,12 +859,22 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
661
859
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
662
860
|
retryCount++;
|
|
663
861
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
664
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
862
|
+
logger_1.logger.warn("Database connection error in getInstitutionalSentimentAlerts, retrying...", {
|
|
863
|
+
operation: 'getInstitutionalSentimentAlerts',
|
|
864
|
+
model: 'InstitutionalSentimentAlerts',
|
|
865
|
+
attempt: retryCount,
|
|
866
|
+
maxRetries: MAX_RETRIES,
|
|
867
|
+
});
|
|
665
868
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
666
869
|
continue;
|
|
667
870
|
}
|
|
668
|
-
// Log
|
|
669
|
-
logger_1.logger.error("Database
|
|
871
|
+
// Log structured error details and rethrow
|
|
872
|
+
logger_1.logger.error("Database get operation failed", {
|
|
873
|
+
operation: 'getInstitutionalSentimentAlerts',
|
|
874
|
+
model: 'InstitutionalSentimentAlerts',
|
|
875
|
+
error: String(error),
|
|
876
|
+
isRetryable: isConnectionError,
|
|
877
|
+
});
|
|
670
878
|
throw error;
|
|
671
879
|
}
|
|
672
880
|
}
|
|
@@ -724,12 +932,22 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
724
932
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
725
933
|
retryCount++;
|
|
726
934
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
727
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
935
|
+
logger_1.logger.warn("Database connection error in getAllInstitutionalSentimentAlerts, retrying...", {
|
|
936
|
+
operation: 'getAllInstitutionalSentimentAlerts',
|
|
937
|
+
model: 'InstitutionalSentimentAlerts',
|
|
938
|
+
attempt: retryCount,
|
|
939
|
+
maxRetries: MAX_RETRIES,
|
|
940
|
+
});
|
|
728
941
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
729
942
|
continue;
|
|
730
943
|
}
|
|
731
|
-
// Log
|
|
732
|
-
logger_1.logger.error("Database
|
|
944
|
+
// Log structured error details and rethrow
|
|
945
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
946
|
+
operation: 'getAllInstitutionalSentimentAlerts',
|
|
947
|
+
model: 'InstitutionalSentimentAlerts',
|
|
948
|
+
error: String(error),
|
|
949
|
+
isRetryable: isConnectionError,
|
|
950
|
+
});
|
|
733
951
|
throw error;
|
|
734
952
|
}
|
|
735
953
|
}
|
|
@@ -803,12 +1021,22 @@ exports.InstitutionalSentimentAlerts = {
|
|
|
803
1021
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
804
1022
|
retryCount++;
|
|
805
1023
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
806
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
1024
|
+
logger_1.logger.warn("Database connection error in findManyInstitutionalSentimentAlerts, retrying...", {
|
|
1025
|
+
operation: 'findManyInstitutionalSentimentAlerts',
|
|
1026
|
+
model: 'InstitutionalSentimentAlerts',
|
|
1027
|
+
attempt: retryCount,
|
|
1028
|
+
maxRetries: MAX_RETRIES,
|
|
1029
|
+
});
|
|
807
1030
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
808
1031
|
continue;
|
|
809
1032
|
}
|
|
810
|
-
// Log
|
|
811
|
-
logger_1.logger.error("Database
|
|
1033
|
+
// Log structured error details and rethrow
|
|
1034
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
1035
|
+
operation: 'findManyInstitutionalSentimentAlerts',
|
|
1036
|
+
model: 'InstitutionalSentimentAlerts',
|
|
1037
|
+
error: String(error),
|
|
1038
|
+
isRetryable: isConnectionError,
|
|
1039
|
+
});
|
|
812
1040
|
throw error;
|
|
813
1041
|
}
|
|
814
1042
|
}
|