update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user