aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-26 00:23:49 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-26 00:23:49 +0200
commita83e9bd36fc6a934553d93cbcc0edb120321f971 (patch)
treea9cc04ca3a0f8392f6ccbf470b323794e535ae7a /main.go
parent87fd0ad3e9309064fe9fda373035f5ce127ae8d8 (diff)
downloadfeed2imap-go-a83e9bd36fc6a934553d93cbcc0edb120321f971.tar.gz
feed2imap-go-a83e9bd36fc6a934553d93cbcc0edb120321f971.tar.bz2
feed2imap-go-a83e9bd36fc6a934553d93cbcc0edb120321f971.zip
Filtering from cache
Diffstat (limited to '')
-rw-r--r--main.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.go b/main.go
index 026ef0a..5b76871 100644
--- a/main.go
+++ b/main.go
@@ -28,6 +28,7 @@ func processFeed(feed *feed.Feed, cfg *config.Config, client *imap.Client, wg *s
}
if len(mails) == 0 {
+ feed.MarkSuccess()
return
}
@@ -43,6 +44,8 @@ func processFeed(feed *feed.Feed, cfg *config.Config, client *imap.Client, wg *s
}
log.Printf("Uploaded %d messages to '%s' @ %s", len(mails), feed.Name, folder)
+
+ feed.MarkSuccess()
}
func run() error {
@@ -82,6 +85,8 @@ func run() error {
return fmt.Errorf("No successfull feed fetch.")
}
+ state.Filter()
+
imapUrl, err := url.Parse(cfg.Target)
if err != nil {
return fmt.Errorf("parsing 'target': %w", err)