summaryrefslogtreecommitdiff
path: root/internal/run.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-10-09 23:28:21 +0300
committerPaul Buetow <paul@buetow.org>2024-10-09 23:28:21 +0300
commit8e23c12025fac69c6c08aa37e690ee24978c6eed (patch)
treea1b5aaba1c73169b1fd1c4d38a639881ded9e15a /internal/run.go
parenta69e38e109f44b85ac068acabe639f48939f1525 (diff)
can abort
Diffstat (limited to 'internal/run.go')
-rw-r--r--internal/run.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/run.go b/internal/run.go
index b628d9c..0457f36 100644
--- a/internal/run.go
+++ b/internal/run.go
@@ -9,6 +9,7 @@ import (
"codeberg.org/snonux/gos/internal/config"
"codeberg.org/snonux/gos/internal/platforms/linkedin"
"codeberg.org/snonux/gos/internal/platforms/mastodon"
+ "codeberg.org/snonux/gos/internal/prompt"
"codeberg.org/snonux/gos/internal/queue"
"codeberg.org/snonux/gos/internal/schedule"
)
@@ -39,6 +40,10 @@ func Run(ctx context.Context, args config.Args) error {
continue
}
if err := mastodon.Post(ctx, args, ent); err != nil {
+ if errors.Is(err, prompt.ErrAborted) {
+ log.Println("Aborted posting to", platform)
+ continue
+ }
return err
}
if err := ent.MarkPosted(); err != nil {
@@ -51,6 +56,10 @@ func Run(ctx context.Context, args config.Args) error {
continue
}
if err := linkedin.Post(ctx, args, ent); err != nil {
+ if errors.Is(err, prompt.ErrAborted) {
+ log.Println("Aborted posting to", platform)
+ continue
+ }
return err
}
if err := ent.MarkPosted(); err != nil {