add debug info

This commit is contained in:
whr819987540 2023-04-27 15:59:04 +08:00
parent 31b19a2f19
commit 2848a224f9
1 changed files with 3 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import (
"crawshaw.io/sqlite" "crawshaw.io/sqlite"
"crawshaw.io/sqlite/sqlitex" "crawshaw.io/sqlite/sqlitex"
"github.com/anacrolix/log"
"github.com/anacrolix/torrent/metainfo" "github.com/anacrolix/torrent/metainfo"
) )
@ -36,6 +37,8 @@ func NewSqlitePieceCompletion(dir string) (ret *sqlitePieceCompletion, err error
if err != nil { if err != nil {
return return
} }
log.Print("create sqlite connection")
err = sqlitex.ExecScript(db, `create table if not exists piece_completion(infohash, "index", complete, unique(infohash, "index"))`) err = sqlitex.ExecScript(db, `create table if not exists piece_completion(infohash, "index", complete, unique(infohash, "index"))`)
if err != nil { if err != nil {
db.Close() db.Close()