summaryrefslogtreecommitdiff
path: root/core/ingest
diff options
context:
space:
mode:
Diffstat (limited to 'core/ingest')
-rw-r--r--core/ingest/ingest.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/ingest/ingest.go b/core/ingest/ingest.go
index d54ff9d..ad80fe5 100644
--- a/core/ingest/ingest.go
+++ b/core/ingest/ingest.go
@@ -12,7 +12,7 @@ type Page struct {
Id int `xml:"id"`
}
-func IngestWikiDump(filePath string, jobQueue chan<- Page) error {
+func WikiDump(filePath string, jobQueue chan<- Page, onProgress func()) error {
file, err := os.Open(filePath)
if err != nil {
return err
@@ -36,6 +36,9 @@ func IngestWikiDump(filePath string, jobQueue chan<- Page) error {
var p Page
if err := decoder.DecodeElement(&p, &se); err == nil {
jobQueue <- p
+ if onProgress != nil {
+ onProgress()
+ }
}
}
}