mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-17 13:23:35 +00:00
performance enhancements
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -7,6 +7,7 @@ const event = {
|
||||
timeEnd: 0,
|
||||
isPublic: false,
|
||||
type: 'event',
|
||||
revision: 0,
|
||||
};
|
||||
|
||||
const delay = {
|
||||
|
||||
Reference in New Issue
Block a user