From 33a0791ab073bd9a9148d6767da307c758b8dafb Mon Sep 17 00:00:00 2001 From: Piotr Grzeskowiak Date: Fri, 22 Mar 2024 11:28:27 +0000 Subject: [PATCH] NIT-1098 dump and restore db in parallel --- jobs/refresh-db.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jobs/refresh-db.yaml b/jobs/refresh-db.yaml index 0448bf4..07f95f4 100644 --- a/jobs/refresh-db.yaml +++ b/jobs/refresh-db.yaml @@ -12,9 +12,9 @@ data: chmod 0600 ~/.pgpass set -x - pg_dump --host="$SRC_DB_HOST" --username="$SRC_DB_USER" --format=custom --no-owner --no-privileges --verbose --file=/tmp/db.dump $SRC_DB_NAME - pg_restore --host="$DST_DB_HOST" --username="$DST_DB_USER" --clean --no-owner --verbose --dbname="$DST_DB_NAME" /tmp/db.dump - rm -v /tmp/db.dump ~/.pgpass + pg_dump --jobs=4 --host="$SRC_DB_HOST" --username="$SRC_DB_USER" --dbname="$SRC_DB_NAME" --no-owner --no-privileges --verbose --format=directory --file=/tmp/db-dump + pg_restore --jobs=4 --host="$DST_DB_HOST" --username="$DST_DB_USER" --dbname="$DST_DB_NAME" --clean --if-exists --no-owner --no-privileges --verbose /tmp/db-dump + rm -rv /tmp/db-dump ~/.pgpass --- apiVersion: batch/v1 kind: Job