mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 10:15:17 -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
|
@ -1825,6 +1825,11 @@ socket.on('error', function (data) {
|
|||
if (data.message && data.message.indexOf('AUTH failed') === 0)
|
||||
location.href = "./403";
|
||||
});
|
||||
var retryOnDisconnect = false;
|
||||
socket.on('maintenance', function (data) {
|
||||
if (data == version)
|
||||
retryOnDisconnect = true;
|
||||
});
|
||||
socket.on('disconnect', function (data) {
|
||||
showStatus(statusType.offline);
|
||||
if (loaded) {
|
||||
|
@ -1833,12 +1838,15 @@ socket.on('disconnect', function (data) {
|
|||
}
|
||||
if (!editor.getOption('readOnly'))
|
||||
editor.setOption('readOnly', true);
|
||||
if (retryOnDisconnect)
|
||||
socket.connect();
|
||||
});
|
||||
socket.on('reconnect', function (data) {
|
||||
//sync back any change in offline
|
||||
emitUserStatus(true);
|
||||
cursorActivity();
|
||||
socket.emit('online users');
|
||||
retryOnDisconnect = false;
|
||||
});
|
||||
socket.on('connect', function (data) {
|
||||
personalInfo['id'] = socket.id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue