Class PostPublisherScheduler
java.lang.Object
io.github.yvasyliev.telegramforwarderbot.service.PostPublisherScheduler
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidScheduled method that publishes approved posts to the Telegram channel.
-
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 inscheduler.post-publisher.cronproperty (default:0 30 8-21 * * *). If no posts are available, it does nothing.
-