Commit bbad81f4 authored by Brian Tiger Chow's avatar Brian Tiger Chow

feat: add time to taskQueue

License: MIT
Signed-off-by: default avatarBrian Tiger Chow <brian@perfmode.com>

Conflicts:
	exchange/bitswap/decision/taskqueue.go
parent 545938aa
......@@ -3,6 +3,7 @@ package decision
import (
"fmt"
"sync"
"time"
wantlist "github.com/jbenet/go-ipfs/exchange/bitswap/wantlist"
peer "github.com/jbenet/go-ipfs/p2p/peer"
......@@ -28,7 +29,9 @@ func newTaskQueue() *taskQueue {
type task struct {
Entry wantlist.Entry
Target peer.ID
Trash bool
Trash bool // TODO make private
created time.Time
}
func (t *task) String() string {
......@@ -46,8 +49,9 @@ func (tl *taskQueue) Push(entry wantlist.Entry, to peer.ID) {
return
}
task := &task{
Entry: entry,
Target: to,
Entry: entry,
Target: to,
created: time.Now(),
}
tl.tasks = append(tl.tasks, task)
tl.taskmap[taskKey(to, entry.Key)] = task
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment