@oondemand/oon-core-back 0.7.20 → 0.7.22
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/package.json
CHANGED
|
@@ -75,6 +75,20 @@ const errorMiddleware = (error, req, res, next) => {
|
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
// Erro comum com statusCode 4xx explícito (ex.: "Token inválido ou
|
|
79
|
+
// expirado." com 401): responde com esse status em vez de virar 500, para
|
|
80
|
+
// o cliente poder voltar ao login.
|
|
81
|
+
if (Number.isInteger(error.statusCode) && error.statusCode >= 400 && error.statusCode < 500) {
|
|
82
|
+
const code = typeof error.code === "string" && error.code ? error.code : `HTTP_${error.statusCode}`;
|
|
83
|
+
const message = String(error.message || "Requisição recusada.");
|
|
84
|
+
return helpers.sendErrorResponse({
|
|
85
|
+
res,
|
|
86
|
+
statusCode: error.statusCode,
|
|
87
|
+
error: { code, message, ...(requestId ? { requestId } : {}) },
|
|
88
|
+
message,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
78
92
|
const databaseFailure = databaseError(error);
|
|
79
93
|
if (databaseFailure) {
|
|
80
94
|
const { statusCode, ...details } = databaseFailure;
|
package/src/delivery/runtime.js
CHANGED
|
@@ -209,10 +209,13 @@ spec:
|
|
|
209
209
|
spec:
|
|
210
210
|
serviceAccountName: oon-runtime
|
|
211
211
|
terminationGracePeriodSeconds: ${TERMINATION_GRACE_SECONDS}
|
|
212
|
+
# DoNotSchedule: com ScheduleAnyway as 2 réplicas de Apps globais ficaram
|
|
213
|
+
# no mesmo nó. Com maxSkew 1 o pod extra do rolling update ainda cabe e,
|
|
214
|
+
# com um único nó, o desvio é zero e nada fica pendente.
|
|
212
215
|
topologySpreadConstraints:
|
|
213
216
|
- maxSkew: 1
|
|
214
217
|
topologyKey: kubernetes.io/hostname
|
|
215
|
-
whenUnsatisfiable:
|
|
218
|
+
whenUnsatisfiable: DoNotSchedule
|
|
216
219
|
labelSelector:
|
|
217
220
|
matchLabels: { app.kubernetes.io/name: ${context.appCode} }
|
|
218
221
|
imagePullSecrets: [{ name: ${infra.REGISTRY_PULL_SECRET_NAME || "ghcr-oon"} }]
|