diff options
| author | alex <[email protected]> | 2026-07-28 20:01:28 +0200 |
|---|---|---|
| committer | alex <[email protected]> | 2026-07-28 20:01:28 +0200 |
| commit | 95ccea8d0244e515947c335ace620838f01be60a (patch) | |
| tree | 1bce68640f72ba4c010f2abecc89d3e61460ab29 /core/ingest/ingest.go | |
| parent | c91c3afd8700138f8eb8a25a4ae422c2c9e46cea (diff) | |
| download | search-engine-95ccea8d0244e515947c335ace620838f01be60a.tar.xz search-engine-95ccea8d0244e515947c335ace620838f01be60a.zip | |
forgor :skull:
Diffstat (limited to 'core/ingest/ingest.go')
| -rw-r--r-- | core/ingest/ingest.go | 5 |
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() + } } } } |
