diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-07-05 21:22:59 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-07-05 21:22:59 +0100 |
commit | d9fa2cab71615df423aedbba64f27061cd8c6447 (patch) | |
tree | 81e7c97fcdcf81c72f08141e180af5c84086e831 /lib/output | |
parent | Simplify PQ upload lambda (diff) | |
download | mygrate-d9fa2cab71615df423aedbba64f27061cd8c6447.tar.bz2 mygrate-d9fa2cab71615df423aedbba64f27061cd8c6447.tar.xz mygrate-d9fa2cab71615df423aedbba64f27061cd8c6447.zip |
Simplify PQ end upload
Diffstat (limited to 'lib/output')
-rw-r--r-- | lib/output/pq/pqConn.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/output/pq/pqConn.cpp b/lib/output/pq/pqConn.cpp index f4e5226..983271e 100644 --- a/lib/output/pq/pqConn.cpp +++ b/lib/output/pq/pqConn.cpp @@ -85,11 +85,7 @@ namespace MyGrate::Output::Pq { void PqConn::endBulkUpload(const char * errormsg) { - int rc; - while (!(rc = PQputCopyEnd(this->conn.get(), errormsg))) { - sleep(1); - } - verify<PqErr>(rc == 1, "copy end rc", conn.get()); + verify<PqErr>(PQputCopyEnd(this->conn.get(), errormsg) == 1, "copy end rc", conn.get()); ResPtr res {PQgetResult(conn.get()), &PQclear}; verify<PqErr>(PQresultStatus(res.get()) == PGRES_COMMAND_OK, "end copy", res.get()); } |