@xuda.io/account_module 1.2.2048 → 1.2.2050

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.
Files changed (3) hide show
  1. package/index.mjs +10 -27
  2. package/index_ms.mjs +6 -2
  3. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2559,19 +2559,11 @@ export const pin_contact = async function (req) {
2559
2559
 
2560
2560
  const contact_save_ret = await save_contact(uid, contact_doc);
2561
2561
 
2562
- global[`_account_module_ch`].sendToQueue(
2563
- 'ws_dashboard_module',
2564
- Buffer.from(
2565
- JSON.stringify({
2566
- method: 'emit_message_to_dashboard',
2567
- data: {
2568
- service: 'contact_pinned',
2569
- to: [uid],
2570
- data: await get_contact_info(uid, null, contact_id),
2571
- },
2572
- }),
2573
- ),
2574
- );
2562
+ ws_dashboard_ms.emit_message_to_dashboard({
2563
+ service: 'contact_pinned',
2564
+ to: [uid],
2565
+ data: await get_contact_info(uid, null, contact_id),
2566
+ });
2575
2567
 
2576
2568
  return contact_save_ret;
2577
2569
  } catch (err) {
@@ -2611,20 +2603,11 @@ export const unpin_contact = async function (req) {
2611
2603
 
2612
2604
  const contact_save_ret = await save_contact(uid, contact_doc);
2613
2605
 
2614
- global[`_account_module_ch`].sendToQueue(
2615
- 'ws_dashboard_module',
2616
- Buffer.from(
2617
- JSON.stringify({
2618
- method: 'emit_message_to_dashboard',
2619
- data: {
2620
- service: 'contact_unpinned',
2621
- to: [uid],
2622
- data: await get_contact_info(uid, null, contact_id),
2623
- },
2624
- }),
2625
- ),
2626
- );
2627
-
2606
+ ws_dashboard_ms.emit_message_to_dashboard({
2607
+ service: 'contact_unpinned',
2608
+ to: [uid],
2609
+ data: await get_contact_info(uid, null, contact_id),
2610
+ });
2628
2611
  return contact_save_ret;
2629
2612
  } catch (err) {
2630
2613
  return {
package/index_ms.mjs CHANGED
@@ -46,7 +46,7 @@ const send_to_queue =async function(ms_method, ...args) {
46
46
  const timeout = setTimeout(() => {
47
47
  delete queue[queue_id];
48
48
  reject(new Error(`Queue timeout for ${ms_method}`));
49
- }, 30000); // 30 second timeout
49
+ }, 300000); // 300 second timeout
50
50
 
51
51
  // Wrap resolve to clean up
52
52
  queue[queue_id].resolve = (value) => {
@@ -61,7 +61,8 @@ const send_to_queue =async function(ms_method, ...args) {
61
61
  delete queue[queue_id];
62
62
  reject(error);
63
63
  };
64
-
64
+
65
+ try{
65
66
  global[`_${global.module_in}_ch`].sendToQueue(
66
67
  'account_module',
67
68
  Buffer.from(
@@ -74,6 +75,9 @@ const send_to_queue =async function(ms_method, ...args) {
74
75
  )
75
76
  );
76
77
 
78
+ }catch(err){
79
+ debugger
80
+ }
77
81
  })
78
82
 
79
83
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.2048",
3
+ "version": "1.2.2050",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {