Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 6c411cc

Browse files
committed
Update mobile main function
1 parent 60b5638 commit 6c411cc

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

mobile/cmd/main.go

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ package main
22

33
import (
44
"fmt"
5-
"os"
6-
"sync"
7-
"time"
8-
95
"github.com/OpenBazaar/openbazaar-go/mobile"
106
"github.com/jessevdk/go-flags"
7+
"os"
8+
"path"
119
)
1210

1311
type Options struct {
@@ -21,7 +19,7 @@ var (
2119
)
2220

2321
func main() {
24-
var dataPath = "/Users/mg/work/ob/openbazaar-go/config_mobile_test"
22+
var dataPath = path.Join(os.TempDir(), "ob-mobile")
2523
if _, err := parser.Parse(); err != nil {
2624
if len(os.Args) > 1 && os.Args[1] == "-h" {
2725
os.Exit(0)
@@ -35,7 +33,6 @@ func main() {
3533
}
3634

3735
var (
38-
wg sync.WaitGroup
3936
n, err = mobile.NewNodeWithConfig(&mobile.NodeConfig{
4037
RepoPath: dataPath,
4138
Testnet: options.TestnetEnabled,
@@ -48,18 +45,5 @@ func main() {
4845
fmt.Println(err.Error())
4946
}
5047

51-
time.Sleep(time.Second * 10)
52-
fmt.Println("restarting...", time.Now())
53-
54-
wg.Add(1)
55-
56-
go func() {
57-
err := n.Restart()
58-
if err != nil {
59-
panic(fmt.Sprintf("failed to restart: %s", err.Error()))
60-
}
61-
}()
62-
63-
wg.Wait()
64-
48+
select{}
6549
}

0 commit comments

Comments
 (0)