From b63cb8f762ab0bba7750d813924c54c3089a66d6 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 22 Sep 2024 17:40:41 +0300 Subject: can gather stats from post history --- internal/run.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'internal/run.go') 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 } -- cgit v1.2.3