Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.

Commit 5af5c74

Browse files
committed
Added background indexing (closes #34)
1 parent 33d8e5c commit 5af5c74

File tree

5 files changed

+45
-15
lines changed

5 files changed

+45
-15
lines changed

bookbrowser.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,12 @@ func main() {
119119
}
120120

121121
s := server.NewServer(addr, bookdir, tempdir, curversion, true, nocovers)
122-
s.RefreshBookIndex()
123-
124-
if len(s.Indexer.BookList()) == 0 {
125-
log.Fatalln("Fatal error: no books found")
126-
}
122+
go func() {
123+
s.RefreshBookIndex()
124+
if len(s.Indexer.BookList()) == 0 {
125+
log.Fatalln("Fatal error: no books found")
126+
}
127+
}()
127128

128129
sigusr.Handle(func() {
129130
log.Println("Booklist refresh triggered by SIGUSR1")

0 commit comments

Comments
 (0)