Implement block fetcher (fixes #781, fixes #3)

This commit is contained in:
Audrius Butkevicius
2014-10-08 23:41:23 +01:00
committed by Jakob Borg
parent 0bc50f7284
commit 1e15b1e0be
3 changed files with 108 additions and 88 deletions

View File

@@ -81,8 +81,9 @@ type service interface {
}
type Model struct {
cfg *config.ConfigWrapper
db *leveldb.DB
cfg *config.ConfigWrapper
db *leveldb.DB
finder *files.BlockFinder
deviceName string
clientName string
@@ -137,6 +138,7 @@ func NewModel(cfg *config.ConfigWrapper, deviceName, clientName, clientVersion s
protoConn: make(map[protocol.DeviceID]protocol.Connection),
rawConn: make(map[protocol.DeviceID]io.Closer),
deviceVer: make(map[protocol.DeviceID]string),
finder: files.NewBlockFinder(db, cfg),
}
var timeout = 20 * 60 // seconds