mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-14 08:18:50 +00:00
perf[orm]: find thread by threadExecutorMap
This commit is contained in:
1 parent
6dd5b3ac65
commit
082c2fa581
6 files changed
+37
-31
No files matched your search
+2
-2
@@ -24,8 +24,8 @@ import java.util.function.BiConsumer;
|
||||
public interface IEntityCache<PK extends Comparable<PK>, E extends IEntity<PK>> {
|
||||
|
||||
/**
|
||||
* EN: Load data from the database to the cache and return a default value with an empty ID if the database does not exist.
|
||||
* CN: 从数据库中加载数据到缓存,如果数据库不存在则返回一个id为空的默认值。
|
||||
* EN: Load data from the database to the cache and return null if the database does not exist.
|
||||
* CN: 从数据库中加载数据到缓存,如果数据库不存在则返回null。
|
||||
*/
|
||||
@Nullable
|
||||
E load(PK pk);
|
||||
|
||||
@@ -63,7 +63,7 @@ public abstract class MongoIdUtils {
|
||||
return document.getLong("count") + 1;
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
logger.info("getIncrementIdFromMongo collection:[{}] document:[{}] default error", collectionName, documentName, t);
|
||||
logger.error("getIncrementIdFromMongo collection:[{}] document:[{}] default error", collectionName, documentName, t);
|
||||
}
|
||||
|
||||
var query = Filters.eq("_id", documentName);
|
||||
@@ -75,7 +75,7 @@ public abstract class MongoIdUtils {
|
||||
var document = collection.findOneAndUpdate(query, Updates.combine(inc, setOnInsert), new FindOneAndUpdateOptions().upsert(true));
|
||||
return null == document ? INIT_ID : document.getLong(COUNT) + 1;
|
||||
} catch (Throwable t) {
|
||||
logger.info("getIncrementIdFromMongo collection:[{}] document:[{}] retry error! ", collectionName, documentName, t);
|
||||
logger.error("getIncrementIdFromMongo collection:[{}] document:[{}] retry error! ", collectionName, documentName, t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user