Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* fix: halo-dev#988

* refactor: word count

* refactor: word count.

* fix: index posts sort field.
  • Loading branch information
ruibaby authored Aug 1, 2020
1 parent d824cca commit 21ed13a
Show file tree
Hide file tree
Showing 26 changed files with 209 additions and 1,463 deletions.
7 changes: 5 additions & 2 deletions src/main/java/run/halo/app/cache/RedisCacheStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ public class RedisCacheStore extends AbstractStringCacheStore {
* Cache container.
*/
private final static ConcurrentHashMap<String, CacheWrapper<String>> CACHE_CONTAINER = new ConcurrentHashMap<>();

private volatile static JedisCluster REDIS;
protected HaloProperties haloProperties;

/**
* Lock.
*/
private Lock lock = new ReentrantLock();
private final Lock lock = new ReentrantLock();

protected HaloProperties haloProperties;

public RedisCacheStore(HaloProperties haloProperties) {
this.haloProperties = haloProperties;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import run.halo.app.model.enums.PostEditorType;
import run.halo.app.model.enums.PostStatus;
import run.halo.app.model.support.HaloConst;
import run.halo.app.model.vo.AdjacentPostVO;
import run.halo.app.model.vo.ArchiveYearVO;
import run.halo.app.model.vo.PostListVO;
import run.halo.app.service.*;
Expand Down Expand Up @@ -96,9 +95,8 @@ public String content(Post post, String token, Model model) {

postService.publishVisitEvent(post.getId());

AdjacentPostVO adjacentPostVO = postService.getAdjacentPosts(post);
adjacentPostVO.getOptionalPrevPost().ifPresent(prevPost -> model.addAttribute("prevPost", postService.convertToDetailVo(prevPost)));
adjacentPostVO.getOptionalNextPost().ifPresent(nextPost -> model.addAttribute("nextPost", postService.convertToDetailVo(nextPost)));
postService.getPrevPost(post).ifPresent(prevPost -> model.addAttribute("prevPost", postService.convertToDetailVo(prevPost)));
postService.getNextPost(post).ifPresent(nextPost -> model.addAttribute("nextPost", postService.convertToDetailVo(nextPost)));

List<Category> categories = postCategoryService.listCategoriesBy(post.getId());
List<Tag> tags = postTagService.listTagsBy(post.getId());
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

34 changes: 0 additions & 34 deletions src/main/java/run/halo/app/model/vo/AdjacentPostVO.java

This file was deleted.

Loading

0 comments on commit 21ed13a

Please sign in to comment.