From 6ef85e964f79e86aa3b4b1fdde7ac10061143ab1 Mon Sep 17 00:00:00 2001 From: patrikx3 Date: Sat, 9 Mar 2024 08:47:42 +0100 Subject: [PATCH] r0b08x [chore] 3/9/2024, 8:47:42 AM --- README.md | 4 +-- artifacts/cluster.md | 2 +- package.json | 2 +- src/service/socket.io/index.js | 1 + .../request/key-get-string-buffer.js | 31 +++++++++++++++++++ 5 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 src/service/socket.io/request/key-get-string-buffer.js diff --git a/README.md b/README.md index 2f6a071..7fe004a 100644 --- a/README.md +++ b/README.md @@ -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.135 +# 🏍️ The p3x-redis-ui-server package motor that is connected to the p3x-redis-ui-material web user interface v2024.4.136 @@ -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.135 +[**P3X-REDIS-UI-SERVER**](https://corifeus.com/redis-ui-server) Build v2024.4.136 [![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) diff --git a/artifacts/cluster.md b/artifacts/cluster.md index fd944ce..18ab3c1 100644 --- a/artifacts/cluster.md +++ b/artifacts/cluster.md @@ -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.135 +[**P3X-REDIS-UI-SERVER**](https://corifeus.com/redis-ui-server) Build v2024.4.136 [![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) diff --git a/package.json b/package.json index 8c086db..356dfe4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p3x-redis-ui-server", - "version": "2024.4.135", + "version": "2024.4.136", "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", diff --git a/src/service/socket.io/index.js b/src/service/socket.io/index.js index 9f3d22d..a2de407 100644 --- a/src/service/socket.io/index.js +++ b/src/service/socket.io/index.js @@ -9,6 +9,7 @@ const socketIoService = function () { const socketio = require('socket.io')(koaService.server, { secure: true, path: '/socket.io', + maxHttpBufferSize: 256 * 1024 * 1024, // 256 MB }); require('./socket')(socketio); diff --git a/src/service/socket.io/request/key-get-string-buffer.js b/src/service/socket.io/request/key-get-string-buffer.js new file mode 100644 index 0000000..a7ae40e --- /dev/null +++ b/src/service/socket.io/request/key-get-string-buffer.js @@ -0,0 +1,31 @@ +const consolePrefix = 'socket.io key get string buffer' + + +module.exports = async (options) => { + const {socket, payload} = options; + + try { + let redis = socket.p3xrs.ioredis + + const key = payload.key; + + + const buffer = await redis.getBuffer(key) + + const socketResult = { + key: key, + status: 'ok', + bufferValue: buffer, + }; + // console.warn('socketResult', socketResult) + socket.emit(options.responseEvent, socketResult) + } catch (e) { + console.error(e) + socket.emit(options.responseEvent, { + status: 'error', + error: e.message, + }) + } + + +}