mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 09:27:25 +00:00
sql: also add a stratum start time column
time column is refreshed at regular interval by the process
This commit is contained in:
parent
472b4d7635
commit
41821cee93
2 changed files with 4 additions and 2 deletions
|
@ -3,6 +3,8 @@
|
|||
|
||||
-- filled by the stratum instance, to allow to handle/watch multiple instances
|
||||
|
||||
ALTER TABLE `stratums` ADD `started` int(11) UNSIGNED NULL AFTER `time`;
|
||||
|
||||
ALTER TABLE `stratums` ADD `workers` int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `algo`;
|
||||
|
||||
ALTER TABLE `stratums` ADD `port` int(6) UNSIGNED NULL AFTER `workers`;
|
||||
|
|
|
@ -87,9 +87,9 @@ void db_register_stratum(YAAMP_DB *db)
|
|||
int t = time(NULL);
|
||||
if(!db) return;
|
||||
|
||||
db_query(db, "INSERT INTO stratums (pid, time, algo, port) VALUES (%d, %d, '%s', %d) "
|
||||
db_query(db, "INSERT INTO stratums (pid, time, started, algo, port) VALUES (%d, %d, %d, '%s', %d) "
|
||||
" ON DUPLICATE KEY UPDATE time=%d, algo='%s', port=%d",
|
||||
pid, t, g_stratum_algo, g_tcp_port,
|
||||
pid, t, t, g_stratum_algo, g_tcp_port,
|
||||
t, g_stratum_algo, g_tcp_port
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue