mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 18:46:01 +01:00
emitting alert when restart is attempted in development mode
This commit is contained in:
@@ -33,6 +33,15 @@ SocketAdmin.before = function(socket, next) {
|
||||
|
||||
SocketAdmin.restart = function(socket, data, callback) {
|
||||
meta.restart();
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
socket.emit('event:alert', {
|
||||
title: 'Restart Not Available',
|
||||
message: 'NodeBB restarting is disabled in development mode.',
|
||||
type: 'warning',
|
||||
timeout: 2500
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/* Topics */
|
||||
|
||||
Reference in New Issue
Block a user