@deinossrl/dgp-agent 1.5.23 → 1.5.24
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/CHANGELOG.md +10 -0
- package/index.mjs +18 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
# Changelog - DGP Agent
|
|
2
2
|
|
|
3
|
+
## [1.5.24] - 2026-01-13
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- Improved progress calculation in `pg_restore`: "dropping" actions are now logged but do not increment the processed object count, preventing the progress from exceeding 100%. "From TOC entry" lines are ignored to avoid double counting.
|
|
7
|
+
|
|
3
8
|
## [1.5.23] - 2026-01-13
|
|
4
9
|
### Fixed
|
|
5
10
|
- **Critical**: Lógica invertida en flags `include_owner` e `include_privileges`. Ahora se respeta correctamente la exclusión con `--no-owner` y `--no-privileges` cuando el usuario desmarca las opciones.
|
|
6
11
|
|
|
12
|
+
## [1.5.23] - 2026-01-13
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- Improved progress calculation in `pg_restore`: "dropping" actions are now logged but do not increment the processed object count, preventing the progress from exceeding 100%. "From TOC entry" lines are ignored to avoid double counting.
|
|
16
|
+
|
|
7
17
|
## [1.5.22] - 2026-01-13
|
|
8
18
|
|
|
9
19
|
### Fixed
|
package/index.mjs
CHANGED
|
@@ -2383,26 +2383,34 @@ async function executePgRestore(command) {
|
|
|
2383
2383
|
const isLoopMessage = trimmed.includes('processing item') || trimmed.includes('processing data');
|
|
2384
2384
|
const now = Date.now();
|
|
2385
2385
|
|
|
2386
|
-
// LOGICA: Filtrar, calcular y MOSTRAR PROGRESO
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2386
|
+
// LOGICA: Filtrar, calcular y MOSTRAR PROGRESO
|
|
2387
|
+
const isDropping = trimmed.includes('dropping');
|
|
2388
|
+
const isCreating = trimmed.includes('processing') || trimmed.includes('creating') || trimmed.includes('restoring') || trimmed.includes('creando') || trimmed.includes('procesando');
|
|
2389
|
+
|
|
2390
|
+
if (isDropping || isCreating) {
|
|
2391
|
+
// Solo incrementar si estamos CREANDO/RESTAURANDO (el TOC cuenta los objetos a crear)
|
|
2392
|
+
// Ignoramos 'dropping' para el contador (es fase de limpieza) y 'from TOC entry' (es redundante)
|
|
2393
|
+
if (isCreating) {
|
|
2394
|
+
processedObjects++;
|
|
2395
|
+
}
|
|
2391
2396
|
|
|
2392
|
-
//
|
|
2397
|
+
// Mostrar progreso en consola (throttled)
|
|
2393
2398
|
if (now - lastLogTime > 500) { // Cada 500ms localmente
|
|
2394
2399
|
let progressMsg = '';
|
|
2400
|
+
const safeProcessed = Math.min(processedObjects, totalObjects || processedObjects); // Cap visualmente
|
|
2401
|
+
|
|
2395
2402
|
if (totalObjects > 0) {
|
|
2396
|
-
const percentage = Math.min(Math.round((
|
|
2397
|
-
progressMsg = `Progreso: ${percentage}% (${
|
|
2403
|
+
const percentage = Math.min(Math.round((safeProcessed / totalObjects) * 100), 100);
|
|
2404
|
+
progressMsg = `Progreso: ${percentage}% (${safeProcessed}/${totalObjects})`;
|
|
2398
2405
|
} else {
|
|
2399
|
-
progressMsg = `Objetos procesados: ${
|
|
2406
|
+
progressMsg = `Objetos procesados: ${safeProcessed}`;
|
|
2400
2407
|
}
|
|
2401
2408
|
|
|
2402
|
-
// Limpiar detalle
|
|
2409
|
+
// Limpiar detalle para el log
|
|
2403
2410
|
let detail = trimmed;
|
|
2404
2411
|
if (detail.includes('processing item')) detail = detail.replace('processing item', '').trim();
|
|
2405
2412
|
if (detail.includes('creating')) detail = detail.replace('creating', 'creando').trim();
|
|
2413
|
+
if (detail.includes('dropping')) detail = detail.replace('dropping', 'limpiando').trim();
|
|
2406
2414
|
|
|
2407
2415
|
progressMsg += ` - ${detail.substring(0, 50)}`;
|
|
2408
2416
|
console.log(`${colors.cyan}[INFO] ${progressMsg}${colors.reset}`);
|