Skip to content

Commit 59da24d

Browse files
committed
Replace PG_STOP_BACKUP_TIMEOUT by archive-timeout
1 parent e199c4a commit 59da24d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/backup.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#include "utils/thread.h"
2525
#include <time.h>
2626

27-
#define PG_STOP_BACKUP_TIMEOUT 300
28-
2927
/*
3028
* Macro needed to parse ptrack.
3129
* NOTE Keep those values syncronised with definitions in ptrack.h
@@ -1858,8 +1856,8 @@ pg_stop_backup(pgBackup *backup)
18581856
}
18591857

18601858
/*
1861-
* Wait for the result of pg_stop_backup(),
1862-
* but no longer than PG_STOP_BACKUP_TIMEOUT seconds
1859+
* Wait for the result of pg_stop_backup(), but no longer than
1860+
* archive_timeout seconds
18631861
*/
18641862
if (pg_stop_backup_is_sent && !in_cleanup)
18651863
{
@@ -1882,14 +1880,14 @@ pg_stop_backup(pgBackup *backup)
18821880
elog(INFO, "wait for pg_stop_backup()");
18831881

18841882
/*
1885-
* If postgres haven't answered in PG_STOP_BACKUP_TIMEOUT seconds,
1883+
* If postgres haven't answered in archive_timeout seconds,
18861884
* send an interrupt.
18871885
*/
1888-
if (pg_stop_backup_timeout > PG_STOP_BACKUP_TIMEOUT)
1886+
if (pg_stop_backup_timeout > archive_timeout)
18891887
{
18901888
pgut_cancel(conn);
18911889
elog(ERROR, "pg_stop_backup doesn't answer in %d seconds, cancel it",
1892-
PG_STOP_BACKUP_TIMEOUT);
1890+
archive_timeout);
18931891
}
18941892
}
18951893
else

0 commit comments

Comments
 (0)