Permalink
Browse files

Change along with sophie change

  • Loading branch information...
1 parent f1d575e commit 20058e95a3ed05c4d2340e8ee3be431e8dad2e12 @daviddengcn committed Mar 13, 2016
Showing with 20 additions and 7 deletions.
  1. +6 −1 .gitignore
  2. +4 −2 index.go
  3. +2 −1 index_test.go
  4. +3 −1 pipelines/crawler/cmain.go
  5. +3 −1 pipelines/mergedocs/mergedocs.go
  6. +2 −1 pipelines/tocrawl/tocrawl.go
View
@@ -20,10 +20,15 @@ _cgo_export.*
_testmain.go
*.exe
+*.gob
+*.bolt
/conf.json
/data/
/logs/
/scripts/backup-conf.json
/server/server
-
+/pipelines/crawler/crawler
+/pipelines/indexer/indexer
+/pipelines/mergedocs/mergedocs
+/pipelines/tocrawl/tocrawl
View
@@ -2,11 +2,13 @@ package gcse
import (
"errors"
+ "io"
"log"
"os"
"path"
"time"
+ "github.com/golangplus/errors"
"github.com/golangplus/sort"
"github.com/golangplus/strings"
"golang.org/x/crypto/ssh/terminal"
@@ -140,7 +142,7 @@ func Index(docDB mr.Input, outDir string) (*index.TokenSetSearcher, error) {
var docInfo DocInfo
for {
if err := it.Next(&pkg, &docInfo); err != nil {
- if err == sophie.EOF {
+ if errorsp.Cause(err) == io.EOF {
break
}
it.Close()
@@ -188,7 +190,7 @@ func Index(docDB mr.Input, outDir string) (*index.TokenSetSearcher, error) {
var hitInfo HitInfo
for {
if err := it.Next(&pkg, &hitInfo.DocInfo); err != nil {
- if err == sophie.EOF {
+ if errorsp.Cause(err) == io.EOF {
break
}
it.Close()
View
@@ -1,6 +1,7 @@
package gcse
import (
+ "io"
"path"
"testing"
@@ -48,7 +49,7 @@ func TestIndex(t *testing.T) {
return &sophie.IterateCloserStruct{
NextF: func(key, val sophie.SophieReader) error {
if index >= len(docs) {
- return sophie.EOF
+ return io.EOF
}
*key.(*sophie.RawString) = sophie.RawString(
docs[index].Package)
@@ -5,10 +5,12 @@ package main
import (
"flag"
+ "io"
"log"
"runtime"
"time"
+ "github.com/golangplus/errors"
"github.com/golangplus/fmt"
"github.com/daviddengcn/bolthelper"
@@ -62,7 +64,7 @@ func loadAllDocsPkgs(in kv.DirInput) error {
var key sophie.RawString
var val gcse.DocInfo
if err := c.Next(&key, &val); err != nil {
- if err == sophie.EOF {
+ if errorsp.Cause(err) == io.EOF {
break
}
return err
@@ -2,10 +2,12 @@ package main
import (
// "fmt"
+ "io"
"log"
"regexp"
"sync/atomic"
+ "github.com/golangplus/errors"
"github.com/golangplus/strings"
"github.com/daviddengcn/gcse"
@@ -91,7 +93,7 @@ func main() {
hasOriginal := false
for {
val, err := nextVal()
- if err == sophie.EOF {
+ if errorsp.Cause(err) == io.EOF {
break
}
if err != nil {
@@ -1,6 +1,7 @@
package main
import (
+ "io"
"log"
"math/rand"
"runtime"
@@ -45,7 +46,7 @@ func loadPackageUpdateTimes(fpDocs sophie.FsPath) (map[string]time.Time, error)
}
for {
if err := it.Next(&pkg, &info); err != nil {
- if err == sophie.EOF {
+ if errorsp.Cause(err) == io.EOF {
break
}
return nil, err

0 comments on commit 20058e9

Please sign in to comment.