mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
rotate level
This commit is contained in:
@@ -47,7 +47,7 @@ rest_server.get(ES_LOG_ENDPOINT, (_req, res) => {
|
|||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
const data = {
|
const data = {
|
||||||
t: new Date().toISOString(),
|
t: new Date().toISOString(),
|
||||||
l: 7, // debug
|
l: (3 + (count % 6)),
|
||||||
i: count,
|
i: count,
|
||||||
n: 'system',
|
n: 'system',
|
||||||
m: 'message #' + count++
|
m: 'message #' + count++
|
||||||
@@ -55,6 +55,8 @@ rest_server.get(ES_LOG_ENDPOINT, (_req, res) => {
|
|||||||
res.write(`data: ${JSON.stringify(data)}\n\n`);
|
res.write(`data: ${JSON.stringify(data)}\n\n`);
|
||||||
}, INTERVAL);
|
}, INTERVAL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if client closes connection
|
// if client closes connection
|
||||||
res.on('close', () => {
|
res.on('close', () => {
|
||||||
console.log('Closing ES connection');
|
console.log('Closing ES connection');
|
||||||
|
|||||||
Reference in New Issue
Block a user