@xuda.io/account_module 1.2.2009 → 1.2.2010

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 (2) hide show
  1. package/index_ms.mjs +17 -1
  2. package/package.json +1 -1
package/index_ms.mjs CHANGED
@@ -8,7 +8,23 @@
8
8
  const channel = await conn.createChannel();
9
9
  await channel.assertQueue(_account_module-`${global.module_in}_ch`, { durable: false });
10
10
 
11
-
11
+ channel.consume(_account_module-`${global.module_in}_ch`, async (msg) => {
12
+ debugger;
13
+ if (msg === null) {
14
+ console.log('Consumer cancelled by server');
15
+ return;
16
+ }
17
+
18
+ const content = JSON.parse(msg.content.toString());
19
+
20
+
21
+ channel.ack(msg);
22
+ } catch (err) {
23
+ channel.ack(msg); // Acknowledge to prevent requeue loops on error
24
+ console.error(module_in, content.method, err.message, err);
25
+ // debugger;
26
+ }
27
+ });
12
28
 
13
29
 
14
30
  const send_to_queue =async function(ms_method, ...args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.2009",
3
+ "version": "1.2.2010",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {