From 2229bd91831c18c3a7779645b1182b78f0489a70 Mon Sep 17 00:00:00 2001 From: lauralani Date: Tue, 11 Jul 2023 10:36:56 +0200 Subject: [PATCH] change posting behavior on startup --- CHANGELOG.md | 9 +++++++-- app/cli.go | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8040f74..8b42f33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- when starting the app in daemon mode, the app will now wait one complete interval until it posts the next post +instead of immediately posting one bundle ## [v0.2.0] - 2023-06-11 ### Added -- Added cli option `queue show` to list currently queued bundles [#2](https://git.lauka.net/lauralani/humble-bot/issues/2) -- Added cli option `queue fill` to query humblebundle.com for new bundles and then fill the queue [#2](https://git.lauka.net/lauralani/humble-bot/issues/2) +- Added cli option `queue show` to list currently queued bundles +[#2](https://git.lauka.net/lauralani/humble-bot/issues/2) +- Added cli option `queue fill` to query humblebundle.com for new bundles and then fill the queue +[#2](https://git.lauka.net/lauralani/humble-bot/issues/2) - Added cli option `queue remove` to remove a queued up bundle [#2](https://git.lauka.net/lauralani/humble-bot/issues/2) ### Fixed diff --git a/app/cli.go b/app/cli.go index 23c748c..4d38d92 100644 --- a/app/cli.go +++ b/app/cli.go @@ -28,7 +28,7 @@ func StartCronJobs() { return } - _, err = s.Every(viper.GetString("mastodon.postinterval")).Do(RunSingleQueueItem) + _, err = s.Every(viper.GetString("mastodon.postinterval")).WaitForSchedule().Do(RunSingleQueueItem) if err != nil { log.Error().Str("func", "StartCronJobs").Str("job", "RunSingleQueueItem"). Msgf("Scheduler Error: %q", err)