Skip to content

Commit 2b0e497

Browse files
authored
Merge pull request #328 from CortexFoundation/dev
Dev
2 parents d6e3775 + 969b9d9 commit 2b0e497

File tree

6 files changed

+31
-28
lines changed

6 files changed

+31
-28
lines changed

start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fi
6161
function start_cvm(){
6262
#./cvm.sh | grep -v 'Terminated ' & #>/dev/null 2>&1 &
6363
#echo $$ > cvm.pid
64-
./cvm.sh 2>/dev/null &
64+
./cvm.sh & #2>/dev/null &
6565
echo $! > ${cvm_pid}
6666
chmod 644 "${cvm_pid}"
6767
}

torrentfs/monitor.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,9 @@ func (m *Monitor) Stop() {
642642
close(m.exitCh)
643643
log.Info("Monitor is waiting to be closed")
644644
m.wg.Wait()
645+
646+
m.blockCache.Purge()
647+
m.sizeCache.Purge()
645648
/*m.wg.Add(1)
646649
m.closeOnce.Do(func() {
647650
defer m.wg.Done()

torrentfs/torrentClient.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ func (t *Torrent) Seed() {
263263
if t.Torrent.Seeding() {
264264
t.status = torrentSeeding
265265
elapsed := time.Duration(mclock.Now()) - time.Duration(t.start)
266-
log.Info("Download success", "hash", t.InfoHash(), "size", common.StorageSize(t.BytesCompleted()), "files", len(t.Files()), "pieces", t.Torrent.NumPieces(), "seg", len(t.Torrent.PieceStateRuns()), "cited", t.cited, "conn", t.currentConns, "elapsed", elapsed)
266+
log.Info("Finish downloading", "hash", t.InfoHash(), "elapsed", elapsed)
267+
//log.Info("Download success", "hash", t.InfoHash(), "size", common.StorageSize(t.BytesCompleted()), "files", len(t.Files()), "pieces", t.Torrent.NumPieces(), "seg", len(t.Torrent.PieceStateRuns()), "cited", t.cited, "conn", t.currentConns, "elapsed", elapsed)
267268
//t.Torrent.Drop()
268269
} else {
269270
//t.Torrent.DownloadAll()
@@ -476,7 +477,7 @@ func (tm *TorrentManager) SetTorrent(ih metainfo.Hash, torrent *Torrent) {
476477
tm.torrents[ih] = torrent
477478
tm.lock.Unlock()
478479
tm.pendingChan <- torrent
479-
log.Info("P <- B", "hash", ih)
480+
log.Debug("P <- B", "hash", ih)
480481
}
481482

482483
func (tm *TorrentManager) Close() error {
@@ -784,7 +785,7 @@ func NewTorrentManager(config *Config, fsid uint64) *TorrentManager {
784785
// "max_activenum", config.MaxActiveNum,
785786
// )
786787
cfg := torrent.NewDefaultClientConfig()
787-
//cfg.DisableUTP = config.DisableUTP
788+
cfg.DisableUTP = config.DisableUTP
788789
cfg.NoDHT = config.DisableDHT
789790
cfg.DisableTCP = config.DisableTCP
790791

@@ -990,10 +991,10 @@ func (tm *TorrentManager) pendingTorrentLoop() {
990991
if t.Torrent.Info() != nil {
991992
if t.start == 0 {
992993
if t.isBoosting {
993-
log.Info("A <- P (BOOST)", "hash", ih, "pieces", t.Torrent.NumPieces(), "boost", t.isBoosting)
994+
log.Info("A <- P (BOOST)", "hash", ih, "boost", t.isBoosting)
994995
t.isBoosting = false
995996
} else {
996-
log.Info("A <- P (UDP)", "hash", ih, "pieces", t.Torrent.NumPieces(), "boost", t.isBoosting)
997+
log.Info("A <- P (UDP)", "hash", ih, "boost", t.isBoosting)
997998
}
998999
t.AddTrackers(tm.trackers)
9991000
t.start = mclock.Now()
@@ -1161,7 +1162,7 @@ func (tm *TorrentManager) activeTorrentLoop() {
11611162
if len(tm.seedingChan) < cap(tm.seedingChan) {
11621163
log.Debug("Path exist", "hash", ih, "path", path.Join(tm.DataDir, ih.String()))
11631164
delete(tm.activeTorrents, ih)
1164-
log.Info("S <- A", "hash", ih) //, "elapsed", time.Duration(mclock.Now())-time.Duration(t.start))
1165+
log.Debug("S <- A", "hash", ih) //, "elapsed", time.Duration(mclock.Now())-time.Duration(t.start))
11651166
//t.start = mclock.Now()
11661167
tm.seedingChan <- t
11671168
}
@@ -1180,7 +1181,7 @@ func (tm *TorrentManager) activeTorrentLoop() {
11801181
} else {
11811182
if len(tm.seedingChan) < cap(tm.seedingChan) {
11821183
delete(tm.activeTorrents, ih)
1183-
log.Info("S <- A", "hash", ih) //, "elapsed", time.Duration(mclock.Now())-time.Duration(t.start))
1184+
log.Debug("S <- A", "hash", ih) //, "elapsed", time.Duration(mclock.Now())-time.Duration(t.start))
11841185
//t.start = mclock.Now()
11851186
tm.seedingChan <- t
11861187
}

torrentfs/torrentfs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ func (tfs *TorrentFS) Stop() error {
133133
}
134134
// Wait until every goroutine terminates.
135135
tfs.monitor.Stop()
136+
tfs.fileCache.Purge()
136137
return nil
137138
}
138139

vendor/github.com/anacrolix/torrent/connection.go

Lines changed: 17 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/anacrolix/torrent/tracker/http.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)