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

Commit

Permalink
Added background indexing (closes #34)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaskin committed Aug 14, 2018
1 parent 33d8e5c commit 5af5c74
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 15 deletions.
11 changes: 6 additions & 5 deletions bookbrowser.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ func main() {
}

s := server.NewServer(addr, bookdir, tempdir, curversion, true, nocovers)
s.RefreshBookIndex()

if len(s.Indexer.BookList()) == 0 {
log.Fatalln("Fatal error: no books found")
}
go func() {
s.RefreshBookIndex()
if len(s.Indexer.BookList()) == 0 {
log.Fatalln("Fatal error: no books found")
}
}()

sigusr.Handle(func() {
log.Println("Booklist refresh triggered by SIGUSR1")
Expand Down
Loading

0 comments on commit 5af5c74

Please sign in to comment.