mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Dev: Extend lock scope over Get_by_exact_id_or_null [#347]
This commit is contained in:
parent
5fa8c20561
commit
560e3c9685
@ -73,13 +73,13 @@ public class Wbase_doc_mgr {
|
|||||||
Wdata_doc rv = null;
|
Wdata_doc rv = null;
|
||||||
synchronized (thread_lock) {
|
synchronized (thread_lock) {
|
||||||
rv = doc_cache.Get_or_null(ttl_bry);
|
rv = doc_cache.Get_or_null(ttl_bry);
|
||||||
}
|
|
||||||
if (rv == null) {
|
if (rv == null) {
|
||||||
// load from db
|
// load from db
|
||||||
rv = Load_wdoc_or_null(ttl_bry);
|
rv = Load_wdoc_or_null(ttl_bry);
|
||||||
if (rv == null) return null; // page not found
|
if (rv == null) return null; // page not found
|
||||||
Add(ttl_bry, rv);// NOTE: use ttl_bry, not rv.Qid; allows subsequent lookups to skip this redirect cycle
|
Add(ttl_bry, rv);// NOTE: use ttl_bry, not rv.Qid; allows subsequent lookups to skip this redirect cycle
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
private Wdata_doc Load_wdoc_or_null(byte[] ttl_bry) { // EX:"Q2" or "Property:P1"
|
private Wdata_doc Load_wdoc_or_null(byte[] ttl_bry) { // EX:"Q2" or "Property:P1"
|
||||||
|
Loading…
Reference in New Issue
Block a user