mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-20 18:09:54 +00:00
backend: allow more cpu threads to do the backup compression
if xz take too much time, mysql buffer can suffer and can overflow Also, drop useless invalid shares after 24h, no more used in graphes
This commit is contained in:
parent
7f28b3d8f5
commit
446cb0187c
1 changed files with 3 additions and 1 deletions
|
@ -6,7 +6,7 @@ function BackendDoBackup()
|
||||||
$filename = "/root/backup/yaamp-$d.sql";
|
$filename = "/root/backup/yaamp-$d.sql";
|
||||||
|
|
||||||
if (is_readable("/usr/bin/xz")) {
|
if (is_readable("/usr/bin/xz")) {
|
||||||
$ziptool = "xz"; $filename .= ".xz";
|
$ziptool = "xz --threads=4"; $filename .= ".xz";
|
||||||
} else {
|
} else {
|
||||||
$ziptool = "gzip"; $filename .= ".gz";
|
$ziptool = "gzip"; $filename .= ".gz";
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,8 @@ function BackendQuickClean()
|
||||||
dborun("delete from earnings where blockid in (select id from blocks where category='orphan')");
|
dborun("delete from earnings where blockid in (select id from blocks where category='orphan')");
|
||||||
dborun("delete from earnings where blockid not in (select id from blocks)");
|
dborun("delete from earnings where blockid not in (select id from blocks)");
|
||||||
dborun("UPDATE blocks SET amount=0 WHERE category='orphan' AND amount>0");
|
dborun("UPDATE blocks SET amount=0 WHERE category='orphan' AND amount>0");
|
||||||
|
$delay = time() - 24*60*60; // drop invalid shares not used anymore (24h graph only)
|
||||||
|
dborun("DELETE FROM shares WHERE valid = 0 AND time < $delay");
|
||||||
}
|
}
|
||||||
|
|
||||||
function marketHistoryPrune($symbol="")
|
function marketHistoryPrune($symbol="")
|
||||||
|
|
Loading…
Add table
Reference in a new issue