Skip to content

Commit

Permalink
r0b08x [chore] 4/25/2024, 2:46:27 AM
Browse files Browse the repository at this point in the history
  • Loading branch information
p3x-robot committed Apr 25, 2024
1 parent c73695e commit 06967a1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ https://corifeus.com/redis-ui


---
# 🏍️ The p3x-redis-ui-server package motor that is connected to the p3x-redis-ui-material web user interface v2024.4.221
# 🏍️ The p3x-redis-ui-server package motor that is connected to the p3x-redis-ui-material web user interface v2024.4.223



Expand Down Expand Up @@ -112,7 +112,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://

---

[**P3X-REDIS-UI-SERVER**](https://corifeus.com/redis-ui-server) Build v2024.4.221
[**P3X-REDIS-UI-SERVER**](https://corifeus.com/redis-ui-server) Build v2024.4.223

[![NPM](https://img.shields.io/npm/v/p3x-redis-ui-server.svg)](https://www.npmjs.com/package/p3x-redis-ui-server) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)

Expand Down
2 changes: 1 addition & 1 deletion artifacts/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://

---

[**P3X-REDIS-UI-SERVER**](https://corifeus.com/redis-ui-server) Build v2024.4.221
[**P3X-REDIS-UI-SERVER**](https://corifeus.com/redis-ui-server) Build v2024.4.223

[![NPM](https://img.shields.io/npm/v/p3x-redis-ui-server.svg)](https://www.npmjs.com/package/p3x-redis-ui-server) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "p3x-redis-ui-server",
"version": "2024.4.221",
"version": "2024.4.223",
"description": "🏍️ The p3x-redis-ui-server package motor that is connected to the p3x-redis-ui-material web user interface",
"corifeus": {
"icon": "fas fa-flag-checkered",
Expand Down
16 changes: 8 additions & 8 deletions src/service/socket.io/request/set-subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ module.exports = async (options) => {
const { socket, payload } = options;

try {
if (socket.p3xrs && socket.p3xrs.subscription) {
// Unsubscribe before clearing the old listener to prevent memory leaks
await socket.p3xrs.ioredisSubscriber.punsubscribe('*');
//console.log('Unsubscribing from all patterns');
await socket.p3xrs.ioredisSubscriber.punsubscribe();
//console.log('All patterns unsubscribed');

socket.p3xrs.ioredisSubscriber.removeAllListeners('pmessage');
//console.log('Removed all pmessage listeners');

// Remove old listeners to prevent multiple listeners from accumulating
socket.p3xrs.ioredisSubscriber.removeAllListeners('pmessage');
}

// Updating subscription settings
socket.p3xrs.subscription = payload.subscription;
Expand All @@ -18,13 +18,13 @@ module.exports = async (options) => {

if (socket.p3xrs.subscription === true) {
// Subscribe to the pattern
//console.log('socket.p3xrs.ioredisSubscriber.psubscribe', payload.subscriberPattern)
await socket.p3xrs.ioredisSubscriber.psubscribe(payload.subscriberPattern);

console.log('socket.p3xrs.subscription', payload.subscriberPattern)

// Handle incoming messages
socket.p3xrs.ioredisSubscriber.on('pmessage', (pattern, channel, message) => {
//console.log('subscription', pattern, channel, message)
console.log('socket.p3xrs.ioredisSubscriber.on(pmessage)', pattern, channel, message)
socket.emit('pubsub-message', {
channel: channel,
message: message,
Expand Down

0 comments on commit 06967a1

Please sign in to comment.