diff options
| author | Paul Buetow <paul@buetow.org> | 2024-09-22 17:40:41 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-09-22 17:40:41 +0300 |
| commit | b63cb8f762ab0bba7750d813924c54c3089a66d6 (patch) | |
| tree | 16aa1cc164cad6e03e1eaf6d3253b28f0ab27009 /internal/run.go | |
| parent | aa1a599f105850e41954ac22de05bf381cfa0d9a (diff) | |
can gather stats from post history
Diffstat (limited to 'internal/run.go')
| -rw-r--r-- | internal/run.go | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/internal/run.go b/internal/run.go index feb69f8..427384d 100644 --- a/internal/run.go +++ b/internal/run.go @@ -2,11 +2,30 @@ package internal import ( "context" + "log" "codeberg.org/snonux/gos/internal/config" "codeberg.org/snonux/gos/internal/queue" + "codeberg.org/snonux/gos/internal/schedule" ) func Run(ctx context.Context, args config.Args) error { - return queue.Run(args) + if err := queue.Run(args); err != nil { + return err + } + + for _, platform := range args.Platforms { + path, err := schedule.Run(args, platform) + switch err { + case nil: + log.Println("Scheduling", path) + // TODO: Implement action here to post it + case schedule.NothingToSchedule: + log.Println("Nothing to be scheduled for", platform) + default: + return err + } + } + + return nil } |
