Browse Source

ckdb - speed up reload - only one DB write per sharesummary

master
kanoi 10 years ago
parent
commit
7ad68d9c2b
  1. 7
      src/ckdb.c

7
src/ckdb.c

@ -4866,6 +4866,10 @@ static bool _sharesummary_update(PGconn *conn, SHARES *s_row, SHAREERRORS *e_row
} }
} }
// During startup, don't save 'new' sharesummaries, to reduce DB I/O
if (!startup_complete && row->complete[0] == SUMMARY_NEW)
goto startupskip;
if (conn == NULL && !confirm_sharesummary) { if (conn == NULL && !confirm_sharesummary) {
conn = dbconnect(); conn = dbconnect();
conned = true; conned = true;
@ -4875,6 +4879,7 @@ static bool _sharesummary_update(PGconn *conn, SHARES *s_row, SHAREERRORS *e_row
MODIFYDATEINIT(row, cd, by, code, inet); MODIFYDATEINIT(row, cd, by, code, inet);
par = 0; par = 0;
if (!confirm_sharesummary) { if (!confirm_sharesummary) {
params[par++] = bigint_to_buf(row->userid, NULL, 0); params[par++] = bigint_to_buf(row->userid, NULL, 0);
params[par++] = str_to_buf(row->workername, NULL, 0); params[par++] = str_to_buf(row->workername, NULL, 0);
@ -5003,7 +5008,7 @@ static bool _sharesummary_update(PGconn *conn, SHARES *s_row, SHAREERRORS *e_row
} }
} }
} }
startupskip:
ok = true; ok = true;
unparam: unparam:
if (par) { if (par) {

Loading…
Cancel
Save