usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [1/3] git commit: add finish check
Date Fri, 22 Aug 2014 20:36:45 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o-notifications-queue 5e30645d8 -> 8a8f7e6b0


add finish check


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/f9cf2f43
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/f9cf2f43
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/f9cf2f43

Branch: refs/heads/two-dot-o-notifications-queue
Commit: f9cf2f4336da39c1edd277489c72a25f78ef5483
Parents: 5e30645
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Fri Aug 22 14:15:33 2014 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Fri Aug 22 14:15:33 2014 -0600

----------------------------------------------------------------------
 .../services/notifications/NotificationsQueueManager.java     | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f9cf2f43/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsQueueManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsQueueManager.java
b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsQueueManager.java
index 93543bd..9f49b2a 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsQueueManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsQueueManager.java
@@ -349,9 +349,9 @@ public class NotificationsQueueManager implements NotificationServiceProxy
{
                         }
                     }, Schedulers.io())
                     .buffer(QueueListener.BATCH_SIZE)
-                    .map(new Func1<List<QueueMessage>, Object>() {
+                    .map(new Func1<List<QueueMessage>, HashMap<UUID, Notification>>()
{
                         @Override
-                        public Object call(List<QueueMessage> queueMessages) {
+                        public HashMap<UUID, Notification> call(List<QueueMessage>
queueMessages) {
                             //for gcm this will actually send notification
                             for (ProviderAdapter providerAdapter : providerAdapters.values())
{
                                 try {
@@ -366,6 +366,7 @@ public class NotificationsQueueManager implements NotificationServiceProxy
{
                                 if (notifications.get(message.getNotificationId()) == null)
{
                                     try {
                                         final Notification notification = em.get(message.getNotificationId(),
Notification.class);
+                                        notifications.put(notification.getUuid(),notification);
                                         finishedBatch(notification, 0, 0);
                                     } catch (Exception e) {
                                         LOG.error("Failed to finish batch", e);
@@ -374,7 +375,7 @@ public class NotificationsQueueManager implements NotificationServiceProxy
{
 
                             }
                             notificationCache.cleanUp();
-                            return null;
+                            return notifications;
                         }
                     });
 


Mime
View raw message