Skip to content

Commit acd5765

Browse files
committed
Merge pull request #2788 from ipfs/fix/buffer-err-chan
Fix/buffer err chan
2 parents 393ae7b + 82a2218 commit acd5765

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

namesys/publisher.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ func checkCtxTTL(ctx context.Context) (time.Duration, bool) {
135135
}
136136

137137
func PutRecordToRouting(ctx context.Context, k ci.PrivKey, value path.Path, seqnum uint64, eol time.Time, r routing.IpfsRouting, id peer.ID) error {
138+
ctx, cancel := context.WithCancel(ctx)
139+
defer cancel()
140+
138141
namekey, ipnskey := IpnsKeysForID(id)
139142
entry, err := CreateRoutingEntryData(k, value, seqnum, eol)
140143
if err != nil {
@@ -146,7 +149,7 @@ func PutRecordToRouting(ctx context.Context, k ci.PrivKey, value path.Path, seqn
146149
entry.Ttl = proto.Uint64(uint64(ttl.Nanoseconds()))
147150
}
148151

149-
errs := make(chan error)
152+
errs := make(chan error, 2)
150153

151154
go func() {
152155
errs <- PublishEntry(ctx, r, ipnskey, entry)

0 commit comments

Comments
 (0)