diff options
author | Bruce Momjian <bruce@momjian.us> | 2005-05-11 17:58:32 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2005-05-11 17:58:32 +0000 |
commit | 928d269abf2dd3e6f7832f6592ebfdd4f1fe70a4 (patch) | |
tree | e2fa540ddebfa89b79d7702fd3e17bb10c03c80f | |
parent | b5e4dc25f14a3b5c023e08738ba2f4e85a881694 (diff) | |
download | postgresql-928d269abf2dd3e6f7832f6592ebfdd4f1fe70a4.tar.gz postgresql-928d269abf2dd3e6f7832f6592ebfdd4f1fe70a4.zip |
Fix pg_autovacuum -s flag to handle values > 2000 by using sleep()
instead of pg_usleep.
Backpatch to 8.0.X.
-rw-r--r-- | contrib/pg_autovacuum/pg_autovacuum.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/contrib/pg_autovacuum/pg_autovacuum.c b/contrib/pg_autovacuum/pg_autovacuum.c index dc8e73d4145..0152e764b32 100644 --- a/contrib/pg_autovacuum/pg_autovacuum.c +++ b/contrib/pg_autovacuum/pg_autovacuum.c @@ -4,7 +4,7 @@ * Revisions by Christopher B. Browne, Liberty RMS * Win32 Service code added by Dave Page * - * $PostgreSQL: pgsql/contrib/pg_autovacuum/pg_autovacuum.c,v 1.27.4.3 2005/04/03 00:02:03 tgl Exp $ + * $PostgreSQL: pgsql/contrib/pg_autovacuum/pg_autovacuum.c,v 1.27.4.4 2005/05/11 17:58:32 momjian Exp $ */ #include "postgres_fe.h" @@ -1743,7 +1743,16 @@ VacuumLoop(int argc, char **argv) fflush(LOGOUTPUT); } - pg_usleep(sleep_secs * 1000000); /* Larger Pause between outer loops */ + /* Larger Pause between outer loops */ + /* + * pg_usleep() is wrong here because its maximum is ~2000 seconds, + * and we don't need signal interruptability on Win32 here. + */ +#ifndef WIN32 + sleep(sleep_secs); /* Unix sleep is seconds */ +#else + sleep(sleep_secs * 1000); /* Win32 sleep() is milliseconds */ +#endif gettimeofday(&then, 0); /* Reset time counter */ |