Class PostPublisherScheduler

java.lang.Object
io.github.yvasyliev.telegramforwarderbot.service.PostPublisherScheduler

@Service public class PostPublisherScheduler extends Object
Scheduler that publishes approved posts to a Telegram channel at a specified time. It polls the ApprovedPostService for ApprovedPosts and sends them to the channel. The schedule is defined by the cron expression and can be configured via scheduler.post-publisher.cron property (default: 0 30 8-21 * * *).
  • Constructor Details

    • PostPublisherScheduler

      public PostPublisherScheduler()
  • Method Details

    • publishPost

      @Scheduled(cron="${scheduler.post-publisher.cron:0 30 8-21 * * *}") public void publishPost()
      Scheduled method that publishes approved posts to the Telegram channel. It runs according to the cron expression defined in scheduler.post-publisher.cron property (default: 0 30 8-21 * * *). If no posts are available, it does nothing.