From 00ed8a41a7e947629c889faffb1c5ff42d8c9203 Mon Sep 17 00:00:00 2001 From: kanoi Date: Mon, 3 Nov 2014 15:07:23 +1100 Subject: [PATCH] ckdb - hack to allow skipping loading temorarily unneeded data --- src/ckdb.c | 20 +++++++++++++++++++- src/ckdb.h | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index 6a22442c..ccb63b11 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -1017,6 +1017,11 @@ static bool setup_data() if (!getdata2() || everyone_die) return false; + if (dbload_workinfoid_start != -1) { + LOGWARNING("WARNING: dbload starting at workinfoid %"PRId64, + dbload_workinfoid_start); + } + if (!getdata3() || everyone_die) return false; @@ -3106,6 +3111,7 @@ static struct option long_options[] = { { "dbuser", required_argument, 0, 'u' }, { "btc-user", required_argument, 0, 'U' }, { "version", no_argument, 0, 'v' }, + { "workinfoid", required_argument, 0, 'w' }, { "confirm", no_argument, 0, 'y' }, { "confirmrange", required_argument, 0, 'Y' }, { 0, 0, 0, 0 } @@ -3138,7 +3144,7 @@ int main(int argc, char **argv) memset(&ckp, 0, sizeof(ckp)); ckp.loglevel = LOG_NOTICE; - while ((c = getopt_long(argc, argv, "c:d:hkl:n:p:P:r:R:s:S:t:u:U:vyY:", long_options, &i)) != -1) { + while ((c = getopt_long(argc, argv, "c:d:hkl:n:p:P:r:R:s:S:t:u:U:vw:yY:", long_options, &i)) != -1) { switch(c) { case 'c': ckp.config = strdup(optarg); @@ -3224,6 +3230,18 @@ int main(int argc, char **argv) break; case 'v': exit(0); + case 'w': + // Don't use this :) + { + int64_t start = atoll(optarg); + if (start < 0) { + quit(1, "Invalid workinfoid start" + " %"PRId64" - must be >= 0", + start); + } + dbload_workinfoid_start = start; + } + break; case 'y': confirm_sharesummary = true; break; diff --git a/src/ckdb.h b/src/ckdb.h index b96700d9..968719a4 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -52,7 +52,7 @@ #define DB_VLOCK "1" #define DB_VERSION "0.9.2" -#define CKDB_VERSION DB_VERSION"-0.580" +#define CKDB_VERSION DB_VERSION"-0.585" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__