mirror of
https://github.com/Sheldan/OnePlusBot.git
synced 2026-03-07 10:05:44 +00:00
[OP-12] fixing truncating date for news posts locks resulting in longer period until it was locked
This commit is contained in:
@@ -52,7 +52,7 @@ public class NewsServiceBean {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void lockNewsPosts() {
|
public void lockNewsPosts() {
|
||||||
Instant oldestDate = Instant.now().minus(postLockSeconds, ChronoUnit.SECONDS).truncatedTo(ChronoUnit.DAYS);
|
Instant oldestDate = Instant.now().minus(postLockSeconds, ChronoUnit.SECONDS);
|
||||||
log.info("Locking news posts older than {}.", oldestDate);
|
log.info("Locking news posts older than {}.", oldestDate);
|
||||||
List<NewsPost> oldPosts = newsPostManagementServiceBean.findNewsPostsOlderNotLocked(oldestDate);
|
List<NewsPost> oldPosts = newsPostManagementServiceBean.findNewsPostsOlderNotLocked(oldestDate);
|
||||||
log.info("Locking {} news posts.", oldPosts.size());
|
log.info("Locking {} news posts.", oldPosts.size());
|
||||||
|
|||||||
Reference in New Issue
Block a user