summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-07-05 21:22:59 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-07-05 21:22:59 +0100
commitd9fa2cab71615df423aedbba64f27061cd8c6447 (patch)
tree81e7c97fcdcf81c72f08141e180af5c84086e831
parentSimplify PQ upload lambda (diff)
downloadmygrate-d9fa2cab71615df423aedbba64f27061cd8c6447.tar.bz2
mygrate-d9fa2cab71615df423aedbba64f27061cd8c6447.tar.xz
mygrate-d9fa2cab71615df423aedbba64f27061cd8c6447.zip
Simplify PQ end upload
-rw-r--r--lib/output/pq/pqConn.cpp6
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());
}