From 5b348f2befaa7afad4a7acd026ff088d267c310b Mon Sep 17 00:00:00 2001 From: kanoi Date: Sat, 10 Sep 2016 22:29:57 +1000 Subject: [PATCH] ckdb - add a console counter when loading payments and miningpayouts --- src/ckdb.h | 2 +- src/ckdb_dbio.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/ckdb.h b/src/ckdb.h index 2a7b5eb2..6681e3a7 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -58,7 +58,7 @@ #define DB_VLOCK "1" #define DB_VERSION "1.0.7" -#define CKDB_VERSION DB_VERSION"-2.453" +#define CKDB_VERSION DB_VERSION"-2.454" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ diff --git a/src/ckdb_dbio.c b/src/ckdb_dbio.c index b44ac45b..de7db918 100644 --- a/src/ckdb_dbio.c +++ b/src/ckdb_dbio.c @@ -2323,6 +2323,7 @@ unparam: bool payments_fill(PGconn *conn) { + char tickbuf[256], pcombuf[64]; ExecStatusType rescode; PGresult *res; K_ITEM *item = NULL; @@ -2335,6 +2336,9 @@ bool payments_fill(PGconn *conn) LOGDEBUG("%s(): select", __func__); + STRNCPY(tickbuf, TICK_PREFIX"pm 0"); + cr_msg(false, tickbuf); + sel = "declare ps cursor for select " "paymentid,payoutid,userid,subname,paydate,payaddress," "originaltxn,amount,diffacc,committxn,commitblockhash" @@ -2449,6 +2453,13 @@ bool payments_fill(PGconn *conn) add_to_ktree(payments_root, item); k_add_head(payments_store, item); + + if (n == 0 || ((n+1) % 100000) == 0) { + pcom(n+1, pcombuf, sizeof(pcombuf)); + snprintf(tickbuf, sizeof(tickbuf), + TICK_PREFIX"pm %s", pcombuf); + cr_msg(false, tickbuf); + } tick(); n++; } @@ -6635,6 +6646,7 @@ unparam: bool miningpayouts_fill(PGconn *conn) { + char tickbuf[256], pcombuf[64]; ExecStatusType rescode; PGresult *res; K_ITEM *item = NULL; @@ -6647,6 +6659,9 @@ bool miningpayouts_fill(PGconn *conn) LOGDEBUG("%s(): select", __func__); + STRNCPY(tickbuf, TICK_PREFIX"mp 0"); + cr_msg(false, tickbuf); + sel = "declare mp cursor for select " "payoutid,userid,diffacc,amount" HISTORYDATECONTROL @@ -6735,6 +6750,13 @@ bool miningpayouts_fill(PGconn *conn) add_to_ktree(miningpayouts_root, item); k_add_head(miningpayouts_store, item); + + if (n == 0 || ((n+1) % 100000) == 0) { + pcom(n+1, pcombuf, sizeof(pcombuf)); + snprintf(tickbuf, sizeof(tickbuf), + TICK_PREFIX"mp %s", pcombuf); + cr_msg(false, tickbuf); + } tick(); n++; }