emitting alert when restart is attempted in development mode

This commit is contained in:
Julian Lam
2014-02-23 22:51:53 -05:00
parent 4ef1d83acd
commit 059c5452ea

View File

@@ -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 */