@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
|
@@ -50,7 +50,7 @@ exports.PortfolioGreeksHistory = {
|
|
|
50
50
|
* @returns The created PortfolioGreeksHistory or null.
|
|
51
51
|
*/
|
|
52
52
|
async create(props, globalClient) {
|
|
53
|
-
var _a, _b, _c, _d, _e;
|
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
54
54
|
// Maximum number of retries for database connection issues
|
|
55
55
|
const MAX_RETRIES = 3;
|
|
56
56
|
let retryCount = 0;
|
|
@@ -104,21 +104,52 @@ exports.PortfolioGreeksHistory = {
|
|
|
104
104
|
}
|
|
105
105
|
catch (error) {
|
|
106
106
|
lastError = error;
|
|
107
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
108
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
109
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
110
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
111
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
112
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
113
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
114
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
115
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
116
|
+
if (isConstraintViolation) {
|
|
117
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
118
|
+
logger_1.logger.error("Non-retryable constraint violation in createOnePortfolioGreeksHistory", {
|
|
119
|
+
operation: 'createOnePortfolioGreeksHistory',
|
|
120
|
+
model: 'PortfolioGreeksHistory',
|
|
121
|
+
error: String(error),
|
|
122
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
123
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
124
|
+
isRetryable: false,
|
|
125
|
+
});
|
|
126
|
+
throw error;
|
|
127
|
+
}
|
|
107
128
|
// Check if this is a database connection error that we should retry
|
|
108
|
-
const isConnectionError = ((
|
|
109
|
-
((
|
|
110
|
-
((
|
|
111
|
-
((
|
|
112
|
-
(error.networkError && ((
|
|
129
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
130
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
131
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
132
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
133
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
113
134
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
114
135
|
retryCount++;
|
|
115
136
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
116
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
137
|
+
logger_1.logger.warn("Database connection error in createOnePortfolioGreeksHistory, retrying...", {
|
|
138
|
+
operation: 'createOnePortfolioGreeksHistory',
|
|
139
|
+
model: 'PortfolioGreeksHistory',
|
|
140
|
+
attempt: retryCount,
|
|
141
|
+
maxRetries: MAX_RETRIES,
|
|
142
|
+
});
|
|
117
143
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
118
144
|
continue;
|
|
119
145
|
}
|
|
120
|
-
// Log
|
|
121
|
-
logger_1.logger.error("Database
|
|
146
|
+
// Log structured error details and rethrow
|
|
147
|
+
logger_1.logger.error("Database create operation failed", {
|
|
148
|
+
operation: 'createOnePortfolioGreeksHistory',
|
|
149
|
+
model: 'PortfolioGreeksHistory',
|
|
150
|
+
error: String(error),
|
|
151
|
+
isRetryable: isConnectionError,
|
|
152
|
+
});
|
|
122
153
|
throw error;
|
|
123
154
|
}
|
|
124
155
|
}
|
|
@@ -133,7 +164,7 @@ exports.PortfolioGreeksHistory = {
|
|
|
133
164
|
* @returns The count of created records or null.
|
|
134
165
|
*/
|
|
135
166
|
async createMany(props, globalClient) {
|
|
136
|
-
var _a, _b, _c, _d, _e;
|
|
167
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
137
168
|
// Maximum number of retries for database connection issues
|
|
138
169
|
const MAX_RETRIES = 3;
|
|
139
170
|
let retryCount = 0;
|
|
@@ -186,21 +217,52 @@ exports.PortfolioGreeksHistory = {
|
|
|
186
217
|
}
|
|
187
218
|
catch (error) {
|
|
188
219
|
lastError = error;
|
|
220
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
221
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
222
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
223
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
224
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
225
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
226
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
227
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
228
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
229
|
+
if (isConstraintViolation) {
|
|
230
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
231
|
+
logger_1.logger.error("Non-retryable constraint violation in createManyPortfolioGreeksHistory", {
|
|
232
|
+
operation: 'createManyPortfolioGreeksHistory',
|
|
233
|
+
model: 'PortfolioGreeksHistory',
|
|
234
|
+
error: String(error),
|
|
235
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
236
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
237
|
+
isRetryable: false,
|
|
238
|
+
});
|
|
239
|
+
throw error;
|
|
240
|
+
}
|
|
189
241
|
// Check if this is a database connection error that we should retry
|
|
190
|
-
const isConnectionError = ((
|
|
191
|
-
((
|
|
192
|
-
((
|
|
193
|
-
((
|
|
194
|
-
(error.networkError && ((
|
|
242
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
243
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
244
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
245
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
246
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
195
247
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
196
248
|
retryCount++;
|
|
197
249
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
198
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
250
|
+
logger_1.logger.warn("Database connection error in createManyPortfolioGreeksHistory, retrying...", {
|
|
251
|
+
operation: 'createManyPortfolioGreeksHistory',
|
|
252
|
+
model: 'PortfolioGreeksHistory',
|
|
253
|
+
attempt: retryCount,
|
|
254
|
+
maxRetries: MAX_RETRIES,
|
|
255
|
+
});
|
|
199
256
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
200
257
|
continue;
|
|
201
258
|
}
|
|
202
|
-
// Log
|
|
203
|
-
logger_1.logger.error("Database
|
|
259
|
+
// Log structured error details and rethrow
|
|
260
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
261
|
+
operation: 'createManyPortfolioGreeksHistory',
|
|
262
|
+
model: 'PortfolioGreeksHistory',
|
|
263
|
+
error: String(error),
|
|
264
|
+
isRetryable: isConnectionError,
|
|
265
|
+
});
|
|
204
266
|
throw error;
|
|
205
267
|
}
|
|
206
268
|
}
|
|
@@ -215,7 +277,7 @@ exports.PortfolioGreeksHistory = {
|
|
|
215
277
|
* @returns The updated PortfolioGreeksHistory or null.
|
|
216
278
|
*/
|
|
217
279
|
async update(props, globalClient) {
|
|
218
|
-
var _a, _b, _c, _d, _e;
|
|
280
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
219
281
|
// Maximum number of retries for database connection issues
|
|
220
282
|
const MAX_RETRIES = 3;
|
|
221
283
|
let retryCount = 0;
|
|
@@ -339,21 +401,55 @@ exports.PortfolioGreeksHistory = {
|
|
|
339
401
|
}
|
|
340
402
|
catch (error) {
|
|
341
403
|
lastError = error;
|
|
404
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
405
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
406
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
407
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
408
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
409
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
410
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
411
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
412
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
413
|
+
if (isConstraintViolation) {
|
|
414
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
415
|
+
logger_1.logger.error("Non-retryable constraint violation in updateOnePortfolioGreeksHistory", {
|
|
416
|
+
operation: 'updateOnePortfolioGreeksHistory',
|
|
417
|
+
model: 'PortfolioGreeksHistory',
|
|
418
|
+
error: String(error),
|
|
419
|
+
recordId: props.id,
|
|
420
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
421
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
422
|
+
isRetryable: false,
|
|
423
|
+
});
|
|
424
|
+
throw error;
|
|
425
|
+
}
|
|
342
426
|
// Check if this is a database connection error that we should retry
|
|
343
|
-
const isConnectionError = ((
|
|
344
|
-
((
|
|
345
|
-
((
|
|
346
|
-
((
|
|
347
|
-
(error.networkError && ((
|
|
427
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
428
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
429
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
430
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
431
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
348
432
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
349
433
|
retryCount++;
|
|
350
434
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
351
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
435
|
+
logger_1.logger.warn("Database connection error in updateOnePortfolioGreeksHistory, retrying...", {
|
|
436
|
+
operation: 'updateOnePortfolioGreeksHistory',
|
|
437
|
+
model: 'PortfolioGreeksHistory',
|
|
438
|
+
attempt: retryCount,
|
|
439
|
+
maxRetries: MAX_RETRIES,
|
|
440
|
+
recordId: props.id,
|
|
441
|
+
});
|
|
352
442
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
353
443
|
continue;
|
|
354
444
|
}
|
|
355
|
-
// Log
|
|
356
|
-
logger_1.logger.error("Database
|
|
445
|
+
// Log structured error details and rethrow
|
|
446
|
+
logger_1.logger.error("Database update operation failed", {
|
|
447
|
+
operation: 'updateOnePortfolioGreeksHistory',
|
|
448
|
+
model: 'PortfolioGreeksHistory',
|
|
449
|
+
error: String(error),
|
|
450
|
+
recordId: props.id,
|
|
451
|
+
isRetryable: isConnectionError,
|
|
452
|
+
});
|
|
357
453
|
throw error;
|
|
358
454
|
}
|
|
359
455
|
}
|
|
@@ -368,7 +464,7 @@ exports.PortfolioGreeksHistory = {
|
|
|
368
464
|
* @returns The updated PortfolioGreeksHistory or null.
|
|
369
465
|
*/
|
|
370
466
|
async upsert(props, globalClient) {
|
|
371
|
-
var _a, _b, _c, _d, _e;
|
|
467
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
372
468
|
// Maximum number of retries for database connection issues
|
|
373
469
|
const MAX_RETRIES = 3;
|
|
374
470
|
let retryCount = 0;
|
|
@@ -498,21 +594,55 @@ exports.PortfolioGreeksHistory = {
|
|
|
498
594
|
}
|
|
499
595
|
catch (error) {
|
|
500
596
|
lastError = error;
|
|
597
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
598
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
599
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
600
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
601
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
602
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
603
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
604
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
605
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
606
|
+
if (isConstraintViolation) {
|
|
607
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
608
|
+
logger_1.logger.error("Non-retryable constraint violation in upsertOnePortfolioGreeksHistory", {
|
|
609
|
+
operation: 'upsertOnePortfolioGreeksHistory',
|
|
610
|
+
model: 'PortfolioGreeksHistory',
|
|
611
|
+
error: String(error),
|
|
612
|
+
recordId: props.id,
|
|
613
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
614
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
615
|
+
isRetryable: false,
|
|
616
|
+
});
|
|
617
|
+
throw error;
|
|
618
|
+
}
|
|
501
619
|
// Check if this is a database connection error that we should retry
|
|
502
|
-
const isConnectionError = ((
|
|
503
|
-
((
|
|
504
|
-
((
|
|
505
|
-
((
|
|
506
|
-
(error.networkError && ((
|
|
620
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
621
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
622
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
623
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
624
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
507
625
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
508
626
|
retryCount++;
|
|
509
627
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
510
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
628
|
+
logger_1.logger.warn("Database connection error in upsertOnePortfolioGreeksHistory, retrying...", {
|
|
629
|
+
operation: 'upsertOnePortfolioGreeksHistory',
|
|
630
|
+
model: 'PortfolioGreeksHistory',
|
|
631
|
+
attempt: retryCount,
|
|
632
|
+
maxRetries: MAX_RETRIES,
|
|
633
|
+
recordId: props.id,
|
|
634
|
+
});
|
|
511
635
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
512
636
|
continue;
|
|
513
637
|
}
|
|
514
|
-
// Log
|
|
515
|
-
logger_1.logger.error("Database
|
|
638
|
+
// Log structured error details and rethrow
|
|
639
|
+
logger_1.logger.error("Database upsert operation failed", {
|
|
640
|
+
operation: 'upsertOnePortfolioGreeksHistory',
|
|
641
|
+
model: 'PortfolioGreeksHistory',
|
|
642
|
+
error: String(error),
|
|
643
|
+
recordId: props.id,
|
|
644
|
+
isRetryable: isConnectionError,
|
|
645
|
+
});
|
|
516
646
|
throw error;
|
|
517
647
|
}
|
|
518
648
|
}
|
|
@@ -527,7 +657,7 @@ exports.PortfolioGreeksHistory = {
|
|
|
527
657
|
* @returns The count of created records or null.
|
|
528
658
|
*/
|
|
529
659
|
async updateMany(props, globalClient) {
|
|
530
|
-
var _a, _b, _c, _d, _e;
|
|
660
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
531
661
|
// Maximum number of retries for database connection issues
|
|
532
662
|
const MAX_RETRIES = 3;
|
|
533
663
|
let retryCount = 0;
|
|
@@ -651,21 +781,52 @@ exports.PortfolioGreeksHistory = {
|
|
|
651
781
|
}
|
|
652
782
|
catch (error) {
|
|
653
783
|
lastError = error;
|
|
784
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
785
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
786
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
787
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
788
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
789
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
790
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
791
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
792
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
793
|
+
if (isConstraintViolation) {
|
|
794
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
795
|
+
logger_1.logger.error("Non-retryable constraint violation in updateManyPortfolioGreeksHistory", {
|
|
796
|
+
operation: 'updateManyPortfolioGreeksHistory',
|
|
797
|
+
model: 'PortfolioGreeksHistory',
|
|
798
|
+
error: String(error),
|
|
799
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
800
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
801
|
+
isRetryable: false,
|
|
802
|
+
});
|
|
803
|
+
throw error;
|
|
804
|
+
}
|
|
654
805
|
// Check if this is a database connection error that we should retry
|
|
655
|
-
const isConnectionError = ((
|
|
656
|
-
((
|
|
657
|
-
((
|
|
658
|
-
((
|
|
659
|
-
(error.networkError && ((
|
|
806
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
807
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
808
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
809
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
810
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
660
811
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
661
812
|
retryCount++;
|
|
662
813
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
663
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
814
|
+
logger_1.logger.warn("Database connection error in updateManyPortfolioGreeksHistory, retrying...", {
|
|
815
|
+
operation: 'updateManyPortfolioGreeksHistory',
|
|
816
|
+
model: 'PortfolioGreeksHistory',
|
|
817
|
+
attempt: retryCount,
|
|
818
|
+
maxRetries: MAX_RETRIES,
|
|
819
|
+
});
|
|
664
820
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
665
821
|
continue;
|
|
666
822
|
}
|
|
667
|
-
// Log
|
|
668
|
-
logger_1.logger.error("Database
|
|
823
|
+
// Log structured error details and rethrow
|
|
824
|
+
logger_1.logger.error("Database updateMany operation failed", {
|
|
825
|
+
operation: 'updateManyPortfolioGreeksHistory',
|
|
826
|
+
model: 'PortfolioGreeksHistory',
|
|
827
|
+
error: String(error),
|
|
828
|
+
isRetryable: isConnectionError,
|
|
829
|
+
});
|
|
669
830
|
throw error;
|
|
670
831
|
}
|
|
671
832
|
}
|
|
@@ -680,7 +841,7 @@ exports.PortfolioGreeksHistory = {
|
|
|
680
841
|
* @returns The deleted PortfolioGreeksHistory or null.
|
|
681
842
|
*/
|
|
682
843
|
async delete(props, globalClient) {
|
|
683
|
-
var _a, _b, _c, _d, _e;
|
|
844
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
684
845
|
// Maximum number of retries for database connection issues
|
|
685
846
|
const MAX_RETRIES = 3;
|
|
686
847
|
let retryCount = 0;
|
|
@@ -724,21 +885,58 @@ exports.PortfolioGreeksHistory = {
|
|
|
724
885
|
}
|
|
725
886
|
catch (error) {
|
|
726
887
|
lastError = error;
|
|
888
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
889
|
+
// (e.g., foreign key constraints preventing deletion)
|
|
890
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
891
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
892
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
893
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
894
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
895
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
896
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('23503')) ||
|
|
897
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2002')) ||
|
|
898
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('P2003')) ||
|
|
899
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('P2014'));
|
|
900
|
+
if (isConstraintViolation) {
|
|
901
|
+
const constraintMatch = (_l = error.message) === null || _l === void 0 ? void 0 : _l.match(/constraint\s+"([^"]+)"/);
|
|
902
|
+
logger_1.logger.error("Non-retryable constraint violation in deleteOnePortfolioGreeksHistory", {
|
|
903
|
+
operation: 'deleteOnePortfolioGreeksHistory',
|
|
904
|
+
model: 'PortfolioGreeksHistory',
|
|
905
|
+
error: String(error),
|
|
906
|
+
recordId: props.id,
|
|
907
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
908
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
909
|
+
isRetryable: false,
|
|
910
|
+
});
|
|
911
|
+
throw error;
|
|
912
|
+
}
|
|
727
913
|
// Check if this is a database connection error that we should retry
|
|
728
|
-
const isConnectionError = ((
|
|
729
|
-
((
|
|
730
|
-
((
|
|
731
|
-
((
|
|
732
|
-
(error.networkError && ((
|
|
914
|
+
const isConnectionError = ((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Server has closed the connection')) ||
|
|
915
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Cannot reach database server')) ||
|
|
916
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('Connection timed out')) ||
|
|
917
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
918
|
+
(error.networkError && ((_r = error.networkError.message) === null || _r === void 0 ? void 0 : _r.includes('Failed to fetch')));
|
|
733
919
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
734
920
|
retryCount++;
|
|
735
921
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
736
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
922
|
+
logger_1.logger.warn("Database connection error in deleteOnePortfolioGreeksHistory, retrying...", {
|
|
923
|
+
operation: 'deleteOnePortfolioGreeksHistory',
|
|
924
|
+
model: 'PortfolioGreeksHistory',
|
|
925
|
+
attempt: retryCount,
|
|
926
|
+
maxRetries: MAX_RETRIES,
|
|
927
|
+
recordId: props.id,
|
|
928
|
+
});
|
|
737
929
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
738
930
|
continue;
|
|
739
931
|
}
|
|
740
|
-
// Log
|
|
741
|
-
logger_1.logger.error("Database
|
|
932
|
+
// Log structured error details and rethrow
|
|
933
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
934
|
+
operation: 'deleteOnePortfolioGreeksHistory',
|
|
935
|
+
model: 'PortfolioGreeksHistory',
|
|
936
|
+
error: String(error),
|
|
937
|
+
recordId: props.id,
|
|
938
|
+
isRetryable: isConnectionError,
|
|
939
|
+
});
|
|
742
940
|
throw error;
|
|
743
941
|
}
|
|
744
942
|
}
|
|
@@ -811,12 +1009,22 @@ exports.PortfolioGreeksHistory = {
|
|
|
811
1009
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
812
1010
|
retryCount++;
|
|
813
1011
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
814
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
1012
|
+
logger_1.logger.warn("Database connection error in getPortfolioGreeksHistory, retrying...", {
|
|
1013
|
+
operation: 'getPortfolioGreeksHistory',
|
|
1014
|
+
model: 'PortfolioGreeksHistory',
|
|
1015
|
+
attempt: retryCount,
|
|
1016
|
+
maxRetries: MAX_RETRIES,
|
|
1017
|
+
});
|
|
815
1018
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
816
1019
|
continue;
|
|
817
1020
|
}
|
|
818
|
-
// Log
|
|
819
|
-
logger_1.logger.error("Database
|
|
1021
|
+
// Log structured error details and rethrow
|
|
1022
|
+
logger_1.logger.error("Database get operation failed", {
|
|
1023
|
+
operation: 'getPortfolioGreeksHistory',
|
|
1024
|
+
model: 'PortfolioGreeksHistory',
|
|
1025
|
+
error: String(error),
|
|
1026
|
+
isRetryable: isConnectionError,
|
|
1027
|
+
});
|
|
820
1028
|
throw error;
|
|
821
1029
|
}
|
|
822
1030
|
}
|
|
@@ -874,12 +1082,22 @@ exports.PortfolioGreeksHistory = {
|
|
|
874
1082
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
875
1083
|
retryCount++;
|
|
876
1084
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
877
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
1085
|
+
logger_1.logger.warn("Database connection error in getAllPortfolioGreeksHistory, retrying...", {
|
|
1086
|
+
operation: 'getAllPortfolioGreeksHistory',
|
|
1087
|
+
model: 'PortfolioGreeksHistory',
|
|
1088
|
+
attempt: retryCount,
|
|
1089
|
+
maxRetries: MAX_RETRIES,
|
|
1090
|
+
});
|
|
878
1091
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
879
1092
|
continue;
|
|
880
1093
|
}
|
|
881
|
-
// Log
|
|
882
|
-
logger_1.logger.error("Database
|
|
1094
|
+
// Log structured error details and rethrow
|
|
1095
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
1096
|
+
operation: 'getAllPortfolioGreeksHistory',
|
|
1097
|
+
model: 'PortfolioGreeksHistory',
|
|
1098
|
+
error: String(error),
|
|
1099
|
+
isRetryable: isConnectionError,
|
|
1100
|
+
});
|
|
883
1101
|
throw error;
|
|
884
1102
|
}
|
|
885
1103
|
}
|
|
@@ -959,12 +1177,22 @@ exports.PortfolioGreeksHistory = {
|
|
|
959
1177
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
960
1178
|
retryCount++;
|
|
961
1179
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
962
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
1180
|
+
logger_1.logger.warn("Database connection error in findManyPortfolioGreeksHistory, retrying...", {
|
|
1181
|
+
operation: 'findManyPortfolioGreeksHistory',
|
|
1182
|
+
model: 'PortfolioGreeksHistory',
|
|
1183
|
+
attempt: retryCount,
|
|
1184
|
+
maxRetries: MAX_RETRIES,
|
|
1185
|
+
});
|
|
963
1186
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
964
1187
|
continue;
|
|
965
1188
|
}
|
|
966
|
-
// Log
|
|
967
|
-
logger_1.logger.error("Database
|
|
1189
|
+
// Log structured error details and rethrow
|
|
1190
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
1191
|
+
operation: 'findManyPortfolioGreeksHistory',
|
|
1192
|
+
model: 'PortfolioGreeksHistory',
|
|
1193
|
+
error: String(error),
|
|
1194
|
+
isRetryable: isConnectionError,
|
|
1195
|
+
});
|
|
968
1196
|
throw error;
|
|
969
1197
|
}
|
|
970
1198
|
}
|