diff --git a/modules/calendar.js b/modules/calendar.js index 4bfa40036086f0aa06601cb80ab82938a1dc6fbe..a3ac2d1af5cd55a1997ad7b926434ed74155d0d1 100644 --- a/modules/calendar.js +++ b/modules/calendar.js @@ -103,12 +103,13 @@ module.exports = function (io) { io.on('connect', function (sock) { sock.emit('calendar', Mustache.render(TEMPLATE, CALENDAR)); }); + function update() { + getData(8, function (data) { + CALENDAR = data; + io.emit('calendar', Mustache.render(TEMPLATE, CALENDAR)); + }); + } + update(); + setInterval(update, 600000); } -function update() { - getData(8, function (data) { - CALENDAR = data; - }); -} -update(); -setInterval(update, 600000);