@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
package/ModelVersionArtifact.cjs
CHANGED
|
@@ -182,7 +182,7 @@ exports.ModelVersionArtifact = {
|
|
|
182
182
|
* @returns The created ModelVersionArtifact or null.
|
|
183
183
|
*/
|
|
184
184
|
async create(props, globalClient) {
|
|
185
|
-
var _a, _b, _c, _d, _e;
|
|
185
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
186
186
|
// Maximum number of retries for database connection issues
|
|
187
187
|
const MAX_RETRIES = 3;
|
|
188
188
|
let retryCount = 0;
|
|
@@ -989,21 +989,52 @@ exports.ModelVersionArtifact = {
|
|
|
989
989
|
}
|
|
990
990
|
catch (error) {
|
|
991
991
|
lastError = error;
|
|
992
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
993
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
994
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
995
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
996
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
997
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
998
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
999
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
1000
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
1001
|
+
if (isConstraintViolation) {
|
|
1002
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
1003
|
+
logger_1.logger.error("Non-retryable constraint violation in createOneModelVersionArtifact", {
|
|
1004
|
+
operation: 'createOneModelVersionArtifact',
|
|
1005
|
+
model: 'ModelVersionArtifact',
|
|
1006
|
+
error: String(error),
|
|
1007
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1008
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1009
|
+
isRetryable: false,
|
|
1010
|
+
});
|
|
1011
|
+
throw error;
|
|
1012
|
+
}
|
|
992
1013
|
// Check if this is a database connection error that we should retry
|
|
993
|
-
const isConnectionError = ((
|
|
994
|
-
((
|
|
995
|
-
((
|
|
996
|
-
((
|
|
997
|
-
(error.networkError && ((
|
|
1014
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
1015
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
1016
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
1017
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1018
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
998
1019
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
999
1020
|
retryCount++;
|
|
1000
1021
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1001
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
1022
|
+
logger_1.logger.warn("Database connection error in createOneModelVersionArtifact, retrying...", {
|
|
1023
|
+
operation: 'createOneModelVersionArtifact',
|
|
1024
|
+
model: 'ModelVersionArtifact',
|
|
1025
|
+
attempt: retryCount,
|
|
1026
|
+
maxRetries: MAX_RETRIES,
|
|
1027
|
+
});
|
|
1002
1028
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1003
1029
|
continue;
|
|
1004
1030
|
}
|
|
1005
|
-
// Log
|
|
1006
|
-
logger_1.logger.error("Database
|
|
1031
|
+
// Log structured error details and rethrow
|
|
1032
|
+
logger_1.logger.error("Database create operation failed", {
|
|
1033
|
+
operation: 'createOneModelVersionArtifact',
|
|
1034
|
+
model: 'ModelVersionArtifact',
|
|
1035
|
+
error: String(error),
|
|
1036
|
+
isRetryable: isConnectionError,
|
|
1037
|
+
});
|
|
1007
1038
|
throw error;
|
|
1008
1039
|
}
|
|
1009
1040
|
}
|
|
@@ -1018,7 +1049,7 @@ exports.ModelVersionArtifact = {
|
|
|
1018
1049
|
* @returns The count of created records or null.
|
|
1019
1050
|
*/
|
|
1020
1051
|
async createMany(props, globalClient) {
|
|
1021
|
-
var _a, _b, _c, _d, _e;
|
|
1052
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1022
1053
|
// Maximum number of retries for database connection issues
|
|
1023
1054
|
const MAX_RETRIES = 3;
|
|
1024
1055
|
let retryCount = 0;
|
|
@@ -1063,21 +1094,52 @@ exports.ModelVersionArtifact = {
|
|
|
1063
1094
|
}
|
|
1064
1095
|
catch (error) {
|
|
1065
1096
|
lastError = error;
|
|
1097
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1098
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
1099
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
1100
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
1101
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
1102
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
1103
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
1104
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
1105
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
1106
|
+
if (isConstraintViolation) {
|
|
1107
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
1108
|
+
logger_1.logger.error("Non-retryable constraint violation in createManyModelVersionArtifact", {
|
|
1109
|
+
operation: 'createManyModelVersionArtifact',
|
|
1110
|
+
model: 'ModelVersionArtifact',
|
|
1111
|
+
error: String(error),
|
|
1112
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1113
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1114
|
+
isRetryable: false,
|
|
1115
|
+
});
|
|
1116
|
+
throw error;
|
|
1117
|
+
}
|
|
1066
1118
|
// Check if this is a database connection error that we should retry
|
|
1067
|
-
const isConnectionError = ((
|
|
1068
|
-
((
|
|
1069
|
-
((
|
|
1070
|
-
((
|
|
1071
|
-
(error.networkError && ((
|
|
1119
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
1120
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
1121
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
1122
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1123
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
1072
1124
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1073
1125
|
retryCount++;
|
|
1074
1126
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1075
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
1127
|
+
logger_1.logger.warn("Database connection error in createManyModelVersionArtifact, retrying...", {
|
|
1128
|
+
operation: 'createManyModelVersionArtifact',
|
|
1129
|
+
model: 'ModelVersionArtifact',
|
|
1130
|
+
attempt: retryCount,
|
|
1131
|
+
maxRetries: MAX_RETRIES,
|
|
1132
|
+
});
|
|
1076
1133
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1077
1134
|
continue;
|
|
1078
1135
|
}
|
|
1079
|
-
// Log
|
|
1080
|
-
logger_1.logger.error("Database
|
|
1136
|
+
// Log structured error details and rethrow
|
|
1137
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
1138
|
+
operation: 'createManyModelVersionArtifact',
|
|
1139
|
+
model: 'ModelVersionArtifact',
|
|
1140
|
+
error: String(error),
|
|
1141
|
+
isRetryable: isConnectionError,
|
|
1142
|
+
});
|
|
1081
1143
|
throw error;
|
|
1082
1144
|
}
|
|
1083
1145
|
}
|
|
@@ -1092,7 +1154,7 @@ exports.ModelVersionArtifact = {
|
|
|
1092
1154
|
* @returns The updated ModelVersionArtifact or null.
|
|
1093
1155
|
*/
|
|
1094
1156
|
async update(props, globalClient) {
|
|
1095
|
-
var _a, _b, _c, _d, _e;
|
|
1157
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1096
1158
|
// Maximum number of retries for database connection issues
|
|
1097
1159
|
const MAX_RETRIES = 3;
|
|
1098
1160
|
let retryCount = 0;
|
|
@@ -4482,21 +4544,55 @@ exports.ModelVersionArtifact = {
|
|
|
4482
4544
|
}
|
|
4483
4545
|
catch (error) {
|
|
4484
4546
|
lastError = error;
|
|
4547
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
4548
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
4549
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
4550
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
4551
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
4552
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
4553
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
4554
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
4555
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
4556
|
+
if (isConstraintViolation) {
|
|
4557
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
4558
|
+
logger_1.logger.error("Non-retryable constraint violation in updateOneModelVersionArtifact", {
|
|
4559
|
+
operation: 'updateOneModelVersionArtifact',
|
|
4560
|
+
model: 'ModelVersionArtifact',
|
|
4561
|
+
error: String(error),
|
|
4562
|
+
recordId: props.id,
|
|
4563
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
4564
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
4565
|
+
isRetryable: false,
|
|
4566
|
+
});
|
|
4567
|
+
throw error;
|
|
4568
|
+
}
|
|
4485
4569
|
// Check if this is a database connection error that we should retry
|
|
4486
|
-
const isConnectionError = ((
|
|
4487
|
-
((
|
|
4488
|
-
((
|
|
4489
|
-
((
|
|
4490
|
-
(error.networkError && ((
|
|
4570
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
4571
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
4572
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
4573
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
4574
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
4491
4575
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
4492
4576
|
retryCount++;
|
|
4493
4577
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
4494
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
4578
|
+
logger_1.logger.warn("Database connection error in updateOneModelVersionArtifact, retrying...", {
|
|
4579
|
+
operation: 'updateOneModelVersionArtifact',
|
|
4580
|
+
model: 'ModelVersionArtifact',
|
|
4581
|
+
attempt: retryCount,
|
|
4582
|
+
maxRetries: MAX_RETRIES,
|
|
4583
|
+
recordId: props.id,
|
|
4584
|
+
});
|
|
4495
4585
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
4496
4586
|
continue;
|
|
4497
4587
|
}
|
|
4498
|
-
// Log
|
|
4499
|
-
logger_1.logger.error("Database
|
|
4588
|
+
// Log structured error details and rethrow
|
|
4589
|
+
logger_1.logger.error("Database update operation failed", {
|
|
4590
|
+
operation: 'updateOneModelVersionArtifact',
|
|
4591
|
+
model: 'ModelVersionArtifact',
|
|
4592
|
+
error: String(error),
|
|
4593
|
+
recordId: props.id,
|
|
4594
|
+
isRetryable: isConnectionError,
|
|
4595
|
+
});
|
|
4500
4596
|
throw error;
|
|
4501
4597
|
}
|
|
4502
4598
|
}
|
|
@@ -4511,7 +4607,7 @@ exports.ModelVersionArtifact = {
|
|
|
4511
4607
|
* @returns The updated ModelVersionArtifact or null.
|
|
4512
4608
|
*/
|
|
4513
4609
|
async upsert(props, globalClient) {
|
|
4514
|
-
var _a, _b, _c, _d, _e;
|
|
4610
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
4515
4611
|
// Maximum number of retries for database connection issues
|
|
4516
4612
|
const MAX_RETRIES = 3;
|
|
4517
4613
|
let retryCount = 0;
|
|
@@ -8660,21 +8756,55 @@ exports.ModelVersionArtifact = {
|
|
|
8660
8756
|
}
|
|
8661
8757
|
catch (error) {
|
|
8662
8758
|
lastError = error;
|
|
8759
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
8760
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
8761
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
8762
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
8763
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
8764
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
8765
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
8766
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
8767
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
8768
|
+
if (isConstraintViolation) {
|
|
8769
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
8770
|
+
logger_1.logger.error("Non-retryable constraint violation in upsertOneModelVersionArtifact", {
|
|
8771
|
+
operation: 'upsertOneModelVersionArtifact',
|
|
8772
|
+
model: 'ModelVersionArtifact',
|
|
8773
|
+
error: String(error),
|
|
8774
|
+
recordId: props.id,
|
|
8775
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
8776
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
8777
|
+
isRetryable: false,
|
|
8778
|
+
});
|
|
8779
|
+
throw error;
|
|
8780
|
+
}
|
|
8663
8781
|
// Check if this is a database connection error that we should retry
|
|
8664
|
-
const isConnectionError = ((
|
|
8665
|
-
((
|
|
8666
|
-
((
|
|
8667
|
-
((
|
|
8668
|
-
(error.networkError && ((
|
|
8782
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
8783
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
8784
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
8785
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
8786
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
8669
8787
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
8670
8788
|
retryCount++;
|
|
8671
8789
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
8672
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
8790
|
+
logger_1.logger.warn("Database connection error in upsertOneModelVersionArtifact, retrying...", {
|
|
8791
|
+
operation: 'upsertOneModelVersionArtifact',
|
|
8792
|
+
model: 'ModelVersionArtifact',
|
|
8793
|
+
attempt: retryCount,
|
|
8794
|
+
maxRetries: MAX_RETRIES,
|
|
8795
|
+
recordId: props.id,
|
|
8796
|
+
});
|
|
8673
8797
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
8674
8798
|
continue;
|
|
8675
8799
|
}
|
|
8676
|
-
// Log
|
|
8677
|
-
logger_1.logger.error("Database
|
|
8800
|
+
// Log structured error details and rethrow
|
|
8801
|
+
logger_1.logger.error("Database upsert operation failed", {
|
|
8802
|
+
operation: 'upsertOneModelVersionArtifact',
|
|
8803
|
+
model: 'ModelVersionArtifact',
|
|
8804
|
+
error: String(error),
|
|
8805
|
+
recordId: props.id,
|
|
8806
|
+
isRetryable: isConnectionError,
|
|
8807
|
+
});
|
|
8678
8808
|
throw error;
|
|
8679
8809
|
}
|
|
8680
8810
|
}
|
|
@@ -8689,7 +8819,7 @@ exports.ModelVersionArtifact = {
|
|
|
8689
8819
|
* @returns The count of created records or null.
|
|
8690
8820
|
*/
|
|
8691
8821
|
async updateMany(props, globalClient) {
|
|
8692
|
-
var _a, _b, _c, _d, _e;
|
|
8822
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
8693
8823
|
// Maximum number of retries for database connection issues
|
|
8694
8824
|
const MAX_RETRIES = 3;
|
|
8695
8825
|
let retryCount = 0;
|
|
@@ -12079,21 +12209,52 @@ exports.ModelVersionArtifact = {
|
|
|
12079
12209
|
}
|
|
12080
12210
|
catch (error) {
|
|
12081
12211
|
lastError = error;
|
|
12212
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
12213
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
12214
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
12215
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
12216
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
12217
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
12218
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
12219
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('P2002')) ||
|
|
12220
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2003'));
|
|
12221
|
+
if (isConstraintViolation) {
|
|
12222
|
+
const constraintMatch = (_j = error.message) === null || _j === void 0 ? void 0 : _j.match(/constraint\s+"([^"]+)"/);
|
|
12223
|
+
logger_1.logger.error("Non-retryable constraint violation in updateManyModelVersionArtifact", {
|
|
12224
|
+
operation: 'updateManyModelVersionArtifact',
|
|
12225
|
+
model: 'ModelVersionArtifact',
|
|
12226
|
+
error: String(error),
|
|
12227
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
12228
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
12229
|
+
isRetryable: false,
|
|
12230
|
+
});
|
|
12231
|
+
throw error;
|
|
12232
|
+
}
|
|
12082
12233
|
// Check if this is a database connection error that we should retry
|
|
12083
|
-
const isConnectionError = ((
|
|
12084
|
-
((
|
|
12085
|
-
((
|
|
12086
|
-
((
|
|
12087
|
-
(error.networkError && ((
|
|
12234
|
+
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
12235
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
12236
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
12237
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
12238
|
+
(error.networkError && ((_p = error.networkError.message) === null || _p === void 0 ? void 0 : _p.includes('Failed to fetch')));
|
|
12088
12239
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
12089
12240
|
retryCount++;
|
|
12090
12241
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
12091
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
12242
|
+
logger_1.logger.warn("Database connection error in updateManyModelVersionArtifact, retrying...", {
|
|
12243
|
+
operation: 'updateManyModelVersionArtifact',
|
|
12244
|
+
model: 'ModelVersionArtifact',
|
|
12245
|
+
attempt: retryCount,
|
|
12246
|
+
maxRetries: MAX_RETRIES,
|
|
12247
|
+
});
|
|
12092
12248
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
12093
12249
|
continue;
|
|
12094
12250
|
}
|
|
12095
|
-
// Log
|
|
12096
|
-
logger_1.logger.error("Database
|
|
12251
|
+
// Log structured error details and rethrow
|
|
12252
|
+
logger_1.logger.error("Database updateMany operation failed", {
|
|
12253
|
+
operation: 'updateManyModelVersionArtifact',
|
|
12254
|
+
model: 'ModelVersionArtifact',
|
|
12255
|
+
error: String(error),
|
|
12256
|
+
isRetryable: isConnectionError,
|
|
12257
|
+
});
|
|
12097
12258
|
throw error;
|
|
12098
12259
|
}
|
|
12099
12260
|
}
|
|
@@ -12108,7 +12269,7 @@ exports.ModelVersionArtifact = {
|
|
|
12108
12269
|
* @returns The deleted ModelVersionArtifact or null.
|
|
12109
12270
|
*/
|
|
12110
12271
|
async delete(props, globalClient) {
|
|
12111
|
-
var _a, _b, _c, _d, _e;
|
|
12272
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
12112
12273
|
// Maximum number of retries for database connection issues
|
|
12113
12274
|
const MAX_RETRIES = 3;
|
|
12114
12275
|
let retryCount = 0;
|
|
@@ -12152,21 +12313,58 @@ exports.ModelVersionArtifact = {
|
|
|
12152
12313
|
}
|
|
12153
12314
|
catch (error) {
|
|
12154
12315
|
lastError = error;
|
|
12316
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
12317
|
+
// (e.g., foreign key constraints preventing deletion)
|
|
12318
|
+
const isConstraintViolation = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('violates check constraint')) ||
|
|
12319
|
+
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('violates unique constraint')) ||
|
|
12320
|
+
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('violates foreign key constraint')) ||
|
|
12321
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('unique constraint')) ||
|
|
12322
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('23514')) ||
|
|
12323
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('23505')) ||
|
|
12324
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('23503')) ||
|
|
12325
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('P2002')) ||
|
|
12326
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('P2003')) ||
|
|
12327
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('P2014'));
|
|
12328
|
+
if (isConstraintViolation) {
|
|
12329
|
+
const constraintMatch = (_l = error.message) === null || _l === void 0 ? void 0 : _l.match(/constraint\s+"([^"]+)"/);
|
|
12330
|
+
logger_1.logger.error("Non-retryable constraint violation in deleteOneModelVersionArtifact", {
|
|
12331
|
+
operation: 'deleteOneModelVersionArtifact',
|
|
12332
|
+
model: 'ModelVersionArtifact',
|
|
12333
|
+
error: String(error),
|
|
12334
|
+
recordId: props.id,
|
|
12335
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
12336
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
12337
|
+
isRetryable: false,
|
|
12338
|
+
});
|
|
12339
|
+
throw error;
|
|
12340
|
+
}
|
|
12155
12341
|
// Check if this is a database connection error that we should retry
|
|
12156
|
-
const isConnectionError = ((
|
|
12157
|
-
((
|
|
12158
|
-
((
|
|
12159
|
-
((
|
|
12160
|
-
(error.networkError && ((
|
|
12342
|
+
const isConnectionError = ((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Server has closed the connection')) ||
|
|
12343
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Cannot reach database server')) ||
|
|
12344
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('Connection timed out')) ||
|
|
12345
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
12346
|
+
(error.networkError && ((_r = error.networkError.message) === null || _r === void 0 ? void 0 : _r.includes('Failed to fetch')));
|
|
12161
12347
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
12162
12348
|
retryCount++;
|
|
12163
12349
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
12164
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
12350
|
+
logger_1.logger.warn("Database connection error in deleteOneModelVersionArtifact, retrying...", {
|
|
12351
|
+
operation: 'deleteOneModelVersionArtifact',
|
|
12352
|
+
model: 'ModelVersionArtifact',
|
|
12353
|
+
attempt: retryCount,
|
|
12354
|
+
maxRetries: MAX_RETRIES,
|
|
12355
|
+
recordId: props.id,
|
|
12356
|
+
});
|
|
12165
12357
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
12166
12358
|
continue;
|
|
12167
12359
|
}
|
|
12168
|
-
// Log
|
|
12169
|
-
logger_1.logger.error("Database
|
|
12360
|
+
// Log structured error details and rethrow
|
|
12361
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
12362
|
+
operation: 'deleteOneModelVersionArtifact',
|
|
12363
|
+
model: 'ModelVersionArtifact',
|
|
12364
|
+
error: String(error),
|
|
12365
|
+
recordId: props.id,
|
|
12366
|
+
isRetryable: isConnectionError,
|
|
12367
|
+
});
|
|
12170
12368
|
throw error;
|
|
12171
12369
|
}
|
|
12172
12370
|
}
|
|
@@ -12239,12 +12437,22 @@ exports.ModelVersionArtifact = {
|
|
|
12239
12437
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
12240
12438
|
retryCount++;
|
|
12241
12439
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
12242
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
12440
|
+
logger_1.logger.warn("Database connection error in getModelVersionArtifact, retrying...", {
|
|
12441
|
+
operation: 'getModelVersionArtifact',
|
|
12442
|
+
model: 'ModelVersionArtifact',
|
|
12443
|
+
attempt: retryCount,
|
|
12444
|
+
maxRetries: MAX_RETRIES,
|
|
12445
|
+
});
|
|
12243
12446
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
12244
12447
|
continue;
|
|
12245
12448
|
}
|
|
12246
|
-
// Log
|
|
12247
|
-
logger_1.logger.error("Database
|
|
12449
|
+
// Log structured error details and rethrow
|
|
12450
|
+
logger_1.logger.error("Database get operation failed", {
|
|
12451
|
+
operation: 'getModelVersionArtifact',
|
|
12452
|
+
model: 'ModelVersionArtifact',
|
|
12453
|
+
error: String(error),
|
|
12454
|
+
isRetryable: isConnectionError,
|
|
12455
|
+
});
|
|
12248
12456
|
throw error;
|
|
12249
12457
|
}
|
|
12250
12458
|
}
|
|
@@ -12302,12 +12510,22 @@ exports.ModelVersionArtifact = {
|
|
|
12302
12510
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
12303
12511
|
retryCount++;
|
|
12304
12512
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
12305
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
12513
|
+
logger_1.logger.warn("Database connection error in getAllModelVersionArtifact, retrying...", {
|
|
12514
|
+
operation: 'getAllModelVersionArtifact',
|
|
12515
|
+
model: 'ModelVersionArtifact',
|
|
12516
|
+
attempt: retryCount,
|
|
12517
|
+
maxRetries: MAX_RETRIES,
|
|
12518
|
+
});
|
|
12306
12519
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
12307
12520
|
continue;
|
|
12308
12521
|
}
|
|
12309
|
-
// Log
|
|
12310
|
-
logger_1.logger.error("Database
|
|
12522
|
+
// Log structured error details and rethrow
|
|
12523
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
12524
|
+
operation: 'getAllModelVersionArtifact',
|
|
12525
|
+
model: 'ModelVersionArtifact',
|
|
12526
|
+
error: String(error),
|
|
12527
|
+
isRetryable: isConnectionError,
|
|
12528
|
+
});
|
|
12311
12529
|
throw error;
|
|
12312
12530
|
}
|
|
12313
12531
|
}
|
|
@@ -12387,12 +12605,22 @@ exports.ModelVersionArtifact = {
|
|
|
12387
12605
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
12388
12606
|
retryCount++;
|
|
12389
12607
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
12390
|
-
logger_1.logger.warn("Database connection error, retrying..."
|
|
12608
|
+
logger_1.logger.warn("Database connection error in findManyModelVersionArtifact, retrying...", {
|
|
12609
|
+
operation: 'findManyModelVersionArtifact',
|
|
12610
|
+
model: 'ModelVersionArtifact',
|
|
12611
|
+
attempt: retryCount,
|
|
12612
|
+
maxRetries: MAX_RETRIES,
|
|
12613
|
+
});
|
|
12391
12614
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
12392
12615
|
continue;
|
|
12393
12616
|
}
|
|
12394
|
-
// Log
|
|
12395
|
-
logger_1.logger.error("Database
|
|
12617
|
+
// Log structured error details and rethrow
|
|
12618
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
12619
|
+
operation: 'findManyModelVersionArtifact',
|
|
12620
|
+
model: 'ModelVersionArtifact',
|
|
12621
|
+
error: String(error),
|
|
12622
|
+
isRetryable: isConnectionError,
|
|
12623
|
+
});
|
|
12396
12624
|
throw error;
|
|
12397
12625
|
}
|
|
12398
12626
|
}
|