Browse Source

Fix bug with restarting server whilst an event remains scheduled

Matt Coles 9 years ago
parent
commit
7b1bea74a9

+ 1 - 1
presenters/event-controller.js

@@ -137,7 +137,7 @@ module.exports = {
137 137
   get_event: function (event_id, auth, complete, preauth) {
138 138
     redis.hgetall("event:" + event_id, function (err, event) {
139 139
       if (preauth) {
140
-        if (event) {
140
+        if (event.name) {
141 141
           event.attendees = JSON.parse(event.attendees);
142 142
           complete({
143 143
             "event": event,

+ 0 - 1
presenters/notification-controller.js

@@ -5,7 +5,6 @@ module.exports = {
5 5
     event_controller.get_event(event_id, "", function (response) {
6 6
       var attendees = response.event.attendees;
7 7
       console.log("Triggered Event: " + response.event.name);
8
-      console.dir(attendees);
9 8
       attendees.map(function (attendee) {
10 9
         console.log((new Date(Date.now())).toString() + " : Sending push notification to " + attendee + " for event starting at " + (new Date(Number(response.event.start)).toString()));
11 10
       });

+ 1 - 1
presenters/schedule-controller.js

@@ -23,7 +23,7 @@ module.exports = {
23 23
     var event_ids = [];
24 24
     stream.on('data', function (keys) {
25 25
       keys.map(function (key) {
26
-        event_ids.push(key);
26
+        event_ids.push(key.split(":")[1]);
27 27
       });
28 28
     })
29 29
     stream.on('end', function () {