aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-06-22 00:45:14 +0000
committerMax Magorsch <arzano@gentoo.org>2020-06-22 00:45:14 +0000
commit2149bb7fb6b6f732ac8364e45d072a22921957db (patch)
treeb72b5b876489df7cbec280b06440b89f9fe46a2d /pkg/importer/importer.go
parentImprove the error handling during the import (diff)
downloadarchives-2149bb7fb6b6f732ac8364e45d072a22921957db.tar.gz
archives-2149bb7fb6b6f732ac8364e45d072a22921957db.tar.bz2
archives-2149bb7fb6b6f732ac8364e45d072a22921957db.zip
Rework the data model to improve the performance
Signed-off-by: Max Magorsch <arzano@gentoo.org>
Diffstat (limited to 'pkg/importer/importer.go')
-rw-r--r--pkg/importer/importer.go23
1 files changed, 6 insertions, 17 deletions
diff --git a/pkg/importer/importer.go b/pkg/importer/importer.go
index 379332c..cdb278d 100644
--- a/pkg/importer/importer.go
+++ b/pkg/importer/importer.go
@@ -2,25 +2,14 @@ package importer
import (
"archives/pkg/config"
- "log"
- "os"
+ "fmt"
"path/filepath"
)
func FullImport() {
- err := filepath.Walk(config.MailDirPath(),
- func(path string, info os.FileInfo, err error) error {
- if err != nil {
- return err
- }
- if !info.IsDir() && getDepth(path, config.MailDirPath()) >= 1 {
- if isPublicList(path) {
- importMail(info.Name(), path, config.MailDirPath())
- }
- }
- return nil
- })
- if err != nil {
- log.Println(err)
- }
+ fmt.Println("Init import...")
+ filepath.Walk(config.MailDirPath(), initImport)
+ fmt.Println("Start import...")
+ filepath.Walk(config.MailDirPath(), importMail)
+ fmt.Println("Finished import.")
}