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 ApprovedPost
s 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 TypeMethodDescriptionvoid
Scheduled 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.cron
property (default:0 30 8-21 * * *
). If no posts are available, it does nothing.
-