@deinossrl/dgp-agent 1.5.22 → 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 +14 -0
- package/index.mjs +22 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +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
|
+
|
|
8
|
+
## [1.5.23] - 2026-01-13
|
|
9
|
+
### Fixed
|
|
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.
|
|
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
|
+
|
|
3
17
|
## [1.5.22] - 2026-01-13
|
|
4
18
|
|
|
5
19
|
### Fixed
|
package/index.mjs
CHANGED
|
@@ -1746,10 +1746,12 @@ async function executePgDump(command) {
|
|
|
1746
1746
|
}
|
|
1747
1747
|
|
|
1748
1748
|
// Incluir opciones adicionales
|
|
1749
|
-
|
|
1749
|
+
// NOTA: pg_dump incluye owner y privilegios por defecto.
|
|
1750
|
+
// Usamos --no-owner y --no-privileges para excluirlos.
|
|
1751
|
+
if (!params.include_privileges) {
|
|
1750
1752
|
pgDumpArgs.push('--no-privileges');
|
|
1751
1753
|
}
|
|
1752
|
-
if (params.include_owner) {
|
|
1754
|
+
if (!params.include_owner) {
|
|
1753
1755
|
pgDumpArgs.push('--no-owner');
|
|
1754
1756
|
}
|
|
1755
1757
|
|
|
@@ -2381,26 +2383,34 @@ async function executePgRestore(command) {
|
|
|
2381
2383
|
const isLoopMessage = trimmed.includes('processing item') || trimmed.includes('processing data');
|
|
2382
2384
|
const now = Date.now();
|
|
2383
2385
|
|
|
2384
|
-
// LOGICA: Filtrar, calcular y MOSTRAR PROGRESO
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
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
|
+
}
|
|
2389
2396
|
|
|
2390
|
-
//
|
|
2397
|
+
// Mostrar progreso en consola (throttled)
|
|
2391
2398
|
if (now - lastLogTime > 500) { // Cada 500ms localmente
|
|
2392
2399
|
let progressMsg = '';
|
|
2400
|
+
const safeProcessed = Math.min(processedObjects, totalObjects || processedObjects); // Cap visualmente
|
|
2401
|
+
|
|
2393
2402
|
if (totalObjects > 0) {
|
|
2394
|
-
const percentage = Math.min(Math.round((
|
|
2395
|
-
progressMsg = `Progreso: ${percentage}% (${
|
|
2403
|
+
const percentage = Math.min(Math.round((safeProcessed / totalObjects) * 100), 100);
|
|
2404
|
+
progressMsg = `Progreso: ${percentage}% (${safeProcessed}/${totalObjects})`;
|
|
2396
2405
|
} else {
|
|
2397
|
-
progressMsg = `Objetos procesados: ${
|
|
2406
|
+
progressMsg = `Objetos procesados: ${safeProcessed}`;
|
|
2398
2407
|
}
|
|
2399
2408
|
|
|
2400
|
-
// Limpiar detalle
|
|
2409
|
+
// Limpiar detalle para el log
|
|
2401
2410
|
let detail = trimmed;
|
|
2402
2411
|
if (detail.includes('processing item')) detail = detail.replace('processing item', '').trim();
|
|
2403
2412
|
if (detail.includes('creating')) detail = detail.replace('creating', 'creando').trim();
|
|
2413
|
+
if (detail.includes('dropping')) detail = detail.replace('dropping', 'limpiando').trim();
|
|
2404
2414
|
|
|
2405
2415
|
progressMsg += ` - ${detail.substring(0, 50)}`;
|
|
2406
2416
|
console.log(`${colors.cyan}[INFO] ${progressMsg}${colors.reset}`);
|