stop use 114514
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user