1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-28 09:33:54 +02:00

Get list of backups in do_backup() as soon as possible

This commit is contained in:
Arthur Zakirov 2017-04-25 12:42:38 +03:00
parent 2bdaaf0eaf
commit c8d5e0338d

View File

@ -432,6 +432,11 @@ do_backup(void)
*/
check_system_identifiers();
/* get list of backups already taken */
backup_list = catalog_get_backup_list(INVALID_BACKUP_ID);
if (backup_list == NULL)
elog(ERROR, "Failed to get backup list.");
elog(LOG, "Backup start. backup-mode = %s, stream = %s",
pgBackupGetBackupMode(&current), current.stream ? "true" : "false");
@ -449,11 +454,6 @@ do_backup(void)
/* set the error processing function for the backup process */
pgut_atexit_push(backup_cleanup, NULL);
/* get list of backups already taken */
backup_list = catalog_get_backup_list(INVALID_BACKUP_ID);
if (backup_list == NULL)
elog(ERROR, "Failed to get backup list.");
/* backup data */
do_backup_database(backup_list);
pgut_atexit_pop(backup_cleanup, NULL);