mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-29 22:35:50 -04:00
Add maintenance mode and update to gracefully exit process on signal
This commit is contained in:
parent
27e17d7772
commit
16d5e3ea80
4 changed files with 43 additions and 3 deletions
lib
|
@ -25,7 +25,9 @@ var realtime = {
|
|||
onAuthorizeFail: onAuthorizeFail,
|
||||
secure: secure,
|
||||
connection: connection,
|
||||
getStatus: getStatus
|
||||
getStatus: getStatus,
|
||||
users: users,
|
||||
notes: notes
|
||||
};
|
||||
|
||||
function onAuthorizeSuccess(data, accept) {
|
||||
|
@ -70,8 +72,9 @@ function emitCheck(note) {
|
|||
}
|
||||
|
||||
//actions
|
||||
var users = {};
|
||||
var notes = {};
|
||||
var users, notes;
|
||||
realtime.users = users = {};
|
||||
realtime.notes = notes = {};
|
||||
//update when the note is dirty
|
||||
var updater = setInterval(function () {
|
||||
async.each(Object.keys(notes), function (key, callback) {
|
||||
|
@ -536,6 +539,7 @@ function ifMayEdit(socket, callback) {
|
|||
}
|
||||
|
||||
function connection(socket) {
|
||||
if (config.maintenance) return;
|
||||
parseNoteIdFromSocket(socket, function (err, noteId) {
|
||||
if (err) {
|
||||
return failConnection(500, err, socket);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue