This commit is contained in:
lzx
2026-01-04 13:57:08 +08:00
parent 68b00962d3
commit f08ad364d9
18 changed files with 408 additions and 136 deletions

View File

@@ -18,7 +18,7 @@ func NewSQLiteServer() *SQLiteServer {
// Open (or create) the SQLite database
db, err := sql.Open("sqlite3", "./mining_task.db")
if err != nil {
log.Fatal(err)
log.Println(err)
return nil
}
@@ -29,7 +29,7 @@ func NewSQLiteServer() *SQLiteServer {
// Initialize the 'task' table
if err := s.initTaskTable(); err != nil {
log.Fatal(err)
log.Println(err)
return nil
}
@@ -79,7 +79,7 @@ func (s *SQLiteServer) LoadMiningTask() (bool, message.ConfigurationMiningMsg) {
// Query the database
rows, err := s.DB.Query(str, params...)
if err != nil {
log.Fatal(err)
log.Println(err)
}
defer rows.Close()
@@ -89,7 +89,7 @@ func (s *SQLiteServer) LoadMiningTask() (bool, message.ConfigurationMiningMsg) {
// Scan the row into the task structure
err := rows.Scan(&task.Coin, &task.Algo, &task.Pool, &task.WalletMining, &task.PoolUrl, &task.WalletAddress, &task.PoolUser, &task.WorkerID, &task.EndTimestamp)
if err != nil {
log.Fatal(err)
log.Println(err)
}
// Check if there's more than one row