@xuda.io/account_module 1.2.1521 → 1.2.1523
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +5 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3003,6 +3003,7 @@ export const get_picture_cache = async function (uid, docType, name, email) {
|
|
|
3003
3003
|
limit: 1,
|
|
3004
3004
|
});
|
|
3005
3005
|
if (ret.docs.length) {
|
|
3006
|
+
save_cache_hit(ret.docs[0]._id);
|
|
3006
3007
|
return ret.docs[0]?.file ?? null;
|
|
3007
3008
|
}
|
|
3008
3009
|
|
|
@@ -3011,11 +3012,13 @@ export const get_picture_cache = async function (uid, docType, name, email) {
|
|
|
3011
3012
|
limit: 1,
|
|
3012
3013
|
});
|
|
3013
3014
|
if (ret.docs.length) {
|
|
3015
|
+
save_cache_hit(ret.docs[0]._id);
|
|
3014
3016
|
return ret.docs[0]?.file ?? null;
|
|
3015
3017
|
}
|
|
3016
3018
|
};
|
|
3017
3019
|
|
|
3018
3020
|
export const save_cache_hit = async function (_id) {
|
|
3019
|
-
let
|
|
3020
|
-
|
|
3021
|
+
let doc_ret = await db_module.get_couch_doc('xuda_cache', _id);
|
|
3022
|
+
doc_ret.data.hit++;
|
|
3023
|
+
await db_module.save_couch_doc('xuda_cache', doc_ret.data);
|
|
3021
3024
|
};
|