warn on re-index - fix hash indexing state issue - cleanup ui mining

This commit is contained in:
nymkappa
2022-02-24 20:20:18 +09:00
parent 582b03ee4e
commit abb96ca064
11 changed files with 45 additions and 53 deletions

View File

@@ -84,10 +84,11 @@ class HashratesRepository {
return rows;
}
public async $setLatestRunTimestamp() {
public async $setLatestRunTimestamp(val: any = null) {
const connection = await DB.pool.getConnection();
const query = `UPDATE state SET number = ? WHERE name = 'last_hashrates_indexing'`;
await connection.query<any>(query, [Math.round(new Date().getTime() / 1000)]);
await connection.query<any>(query, (val === null) ? [Math.round(new Date().getTime() / 1000)] : [val]);
connection.release();
}