Skip to content

Commit

Permalink
review: address pr comments
Browse files Browse the repository at this point in the history
Signed-off-by: Sander Pick <[email protected]>
  • Loading branch information
sanderpick committed Nov 8, 2019
1 parent 81cb938 commit 11d50e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
3 changes: 2 additions & 1 deletion exe/shell/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ func cmdCmd() (out string, err error) {
out += pink(":address ") + grey("Show the host or active thread addresses.\n")
out += pink(":threads ") + grey("Show threads.\n")
out += pink(":add <name> ") + grey("Add a new thread with name.\n")
out += pink(":add <name> <address> <follow-key> <read-key> ") + grey("Add an existing thread with name at address using follow and read keys.\n")
out += pink(":add <name> <address> <follow-key> <read-key> ") +
grey("Add an existing thread with name at address using a base58-encoded follow and read key.\n")
out += pink(":<name> <message> ") + grey("Send a message to thread with name.\n")
out += pink(":<name>:address ") + grey("Show thread address.\n")
out += pink(":<name>:keys ") + grey("Show thread keys.\n")
Expand Down
2 changes: 1 addition & 1 deletion test/keybook_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func testKeyBookThreads(kb tstore.KeyBook) func(t *testing.T) {

kbThreads, err := kb.ThreadsFromKeys()
if err != nil {
t.Fatalf("error when getting threas from keys: %v", err)
t.Fatalf("error when getting thread from keys: %v", err)
}
sort.Sort(kbThreads)
sort.Sort(threads)
Expand Down
14 changes: 3 additions & 11 deletions threads.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ import (
"google.golang.org/grpc"
)

// pull over JWT stuff
// create thread over websocket
// sk for log stays in on the proxy, but a jwt is returned
// read key client only?
// use jwt for

// in relay mode, add records like they are added locally

func init() {
ma.SwapToP2pMultiaddrs() // /ipfs -> /p2p for peer addresses
}
Expand Down Expand Up @@ -712,9 +704,6 @@ func (t *threads) getLocalRecords(
// startPulling periodically pulls on all threads.
// @todo: Ensure that a thread is not pulled concurrently (#26).
func (t *threads) startPulling() {
tick := time.NewTicker(PullInterval)
defer tick.Stop()

pull := func() {
ts, err := t.store.Threads()
if err != nil {
Expand All @@ -735,6 +724,9 @@ func (t *threads) startPulling() {
pull()
}

tick := time.NewTicker(PullInterval)
defer tick.Stop()

for {
select {
case <-tick.C:
Expand Down

0 comments on commit 11d50e2

Please sign in to comment.