From 341b85dc4862bf3a421eb3b62daf9acccea6f22c Mon Sep 17 00:00:00 2001 From: Haris Razis Date: Fri, 18 Dec 2020 12:46:37 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Rename=20influx=20actions=20to?= =?UTF-8?q?=20avoid=20conflict=20with=20npm=20package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/actions/influx_actions.js | 6 +++--- server/services/socket.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/actions/influx_actions.js b/server/actions/influx_actions.js index c7edb1e..a787e8a 100644 --- a/server/actions/influx_actions.js +++ b/server/actions/influx_actions.js @@ -4,7 +4,7 @@ const chalk = require('chalk') const {writeApi, queryApi} = require('../connections/influx_conn') const {bucket} = require('../config/keys') -write = (pointName, uuid, measurement) => { +iWrite = (pointName, uuid, measurement) => { const point = new Point(pointName) .tag('client', uuid) .floatField('value', measurement); @@ -26,7 +26,7 @@ closeWrite = () => { }); } -query = (timeFrame, filter) => { +iPoint = (timeFrame, filter) => { const query = `from(bucket: "${bucket}") |> range(start: -${timeFrame}) |> group(columns: ["client"]) |> filter(fn: (r) => r._measurement == "${filter}")`; @@ -39,4 +39,4 @@ query = (timeFrame, filter) => { }); } -module.exports = {write, closeWrite, query} +module.exports = {iWrite, closeWrite, iPoint} diff --git a/server/services/socket.js b/server/services/socket.js index 1ed9c50..d32ac51 100644 --- a/server/services/socket.js +++ b/server/services/socket.js @@ -2,7 +2,7 @@ const socket = require('socket.io'); const chalk = require('chalk'); const {pub, sub} = require('../connections/redis_conn') -const {write, closeWrite, query} = require('../actions/influx_actions') +const {iWrite, closeWrite, iQuery} = require('../actions/influx_actions') module.exports = (server) => { // noinspection JSValidateTypes @@ -19,7 +19,7 @@ module.exports = (server) => { const {measurement, pointName} = data; pub.publish('data', measurement); - write(socket.id, measurement, pointName) + iWrite(pointName, socket.id, measurement) }) }); } \ No newline at end of file