performance enhancements

This commit is contained in:
cv
2021-05-02 15:05:32 +02:00
parent 7f94907056
commit 9715e13152
11 changed files with 137 additions and 63 deletions
+7
View File
@@ -1,5 +1,7 @@
const Timer = require('./Timer');
const socketIo = require('socket.io');
// DEBUG
const { instrument } = require("@socket.io/admin-ui");
/*
* EventTimer adds functions specific to APP
@@ -71,6 +73,11 @@ class EventTimer extends Timer {
},
});
// DEBUG
instrument(this.io, {
auth: false
});
// set recurrent emits
this._interval = setInterval(
() => this.broadcastTimer(),
+2
View File
@@ -14,6 +14,7 @@ function incrementFrom(start, incr = 1) {
db.get('events')
.find({ id: e.id })
.assign({ order: e.order + incr })
.update('revision', (n) => n + 1)
.write();
});
}
@@ -163,6 +164,7 @@ exports.eventsPatch = async (req, res) => {
db.get('events')
.find({ id: req.body.id })
.assign({ ...req.body })
.update('revision', (n) => n + 1)
.write();
// update timer
+1
View File
@@ -7,6 +7,7 @@ const event = {
timeEnd: 0,
isPublic: false,
type: 'event',
revision: 0,
};
const delay = {