stop use 114514

This commit is contained in:
2022-10-20 23:02:23 +08:00
parent 1a04c41846
commit 0a5af9f35f
2 changed files with 4 additions and 2 deletions

View File

@@ -182,7 +182,9 @@ pub async fn block(bi: Form<BlockInput>, user: CurrentUser, db: Db, rconn: RdsCo
let curr = if blk.add(&nh_to_block).await? > 0 { let curr = if blk.add(&nh_to_block).await? > 0 {
BlockCounter::count_incr(&rconn, &nh_to_block).await? BlockCounter::count_incr(&rconn, &nh_to_block).await?
} else { } else {
114514 BlockCounter::get_count(&rconn, &nh_to_block)
.await?
.unwrap_or_default()
}; };
BlockDictCache::init(&user.namehash, pid, &rconn) BlockDictCache::init(&user.namehash, pid, &rconn)

View File

@@ -241,7 +241,7 @@ impl BlockedUsers {
pub struct BlockCounter; pub struct BlockCounter;
impl BlockCounter { impl BlockCounter {
pub async fn count_incr(rconn: &RdsConn, namehash: &str) -> RedisResult<usize> { pub async fn count_incr(rconn: &RdsConn, namehash: &str) -> RedisResult<i32> {
rconn.clone().hincr(KEY_BLOCKED_COUNTER, namehash, 1).await rconn.clone().hincr(KEY_BLOCKED_COUNTER, namehash, 1).await
} }