Skip to content
This repository was archived by the owner on Jan 23, 2022. It is now read-only.

Commit 4021323

Browse files
committed
Fix bug and don't wait filling to complete
1 parent 57ee649 commit 4021323

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

service/dor-web-inmemory/dor-inmemory.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package main
22

33
import (
44
"flag"
5-
"fmt"
65
"log"
76
"time"
87

@@ -13,19 +12,18 @@ import (
1312
const duration = time.Hour * 24
1413

1514
func main() {
16-
bindAddr := flag.String("host", "127.0.0.1", "IP-address to bind")
17-
bindPort := flag.String("port", "8080", "Port to bind")
15+
bindAddr := flag.String("listen", "127.0.0.1:8080", "Listen address and port to bind")
1816
flag.Parse()
19-
hp := fmt.Sprintf("%s:%s", *bindAddr, *bindPort)
20-
21-
d, err := dor.New("mongodb", "", false)
17+
d, err := dor.New("memory", "", false)
2218
if err != nil {
2319
panic(err)
2420
}
2521

26-
if err := d.FillByTimer(duration); err != nil {
27-
log.Fatal(err)
28-
}
22+
go func() {
23+
if err := d.FillByTimer(duration); err != nil {
24+
log.Fatal(err)
25+
}
26+
}()
2927

30-
dorweb.Serve(hp, d)
28+
dorweb.Serve(*bindAddr, d)
3129
}

0 commit comments

Comments
 (0)