@xuda.io/account_module 1.2.1578 → 1.2.1580
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 +4 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1919,6 +1919,7 @@ setTimeout(async () => {
|
|
|
1919
1919
|
// ret = await set_contact_profile_picture(uid, 'cnt_2d21d55f8f0cdaf65a7a69f69617f532', {}, null, {});
|
|
1920
1920
|
// ret = await get_picture_cache(uid, 'chat_thumbnail', 'word five title');
|
|
1921
1921
|
// add_ai_credits_to_active_accounts();
|
|
1922
|
+
ai_credits_expiration();
|
|
1922
1923
|
console.log(ret);
|
|
1923
1924
|
}, 1000);
|
|
1924
1925
|
|
|
@@ -3133,10 +3134,11 @@ export const add_ai_credits_to_active_accounts = async function () {
|
|
|
3133
3134
|
}
|
|
3134
3135
|
};
|
|
3135
3136
|
|
|
3136
|
-
export const
|
|
3137
|
+
export const ai_credits_expiration = async function () {
|
|
3137
3138
|
const _24_hr_ms = 1000 * 60 * 60 * 24;
|
|
3138
3139
|
const _mo_ms = _24_hr_ms * 30;
|
|
3139
|
-
|
|
3140
|
+
// debugger;
|
|
3141
|
+
const active_ai_credits = await db_module.find_couch_query('xuda_billing', { selector: { stat: 3, docType: 'ai_credit', date_created_ts: { $lt: Date.now() - _mo_ms } }, limit: 99999 });
|
|
3140
3142
|
for await (let ai_credit_doc of active_ai_credits.docs) {
|
|
3141
3143
|
ai_credit_doc.stat = 5;
|
|
3142
3144
|
ai_credit_doc.stat_ts = Date.now();
|