aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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.")
}