usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject git commit: always send now
Date Wed, 01 Oct 2014 21:30:02 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o 74cca91ce -> 1e7da5c8e


always send now


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

Branch: refs/heads/two-dot-o
Commit: 1e7da5c8eb4502fe000b71492e834525839372ea
Parents: 74cca91
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Wed Oct 1 15:23:32 2014 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Wed Oct 1 15:23:32 2014 -0600

----------------------------------------------------------------------
 .../services/notifications/ApplicationQueueManager.java     | 9 ++++++---
 .../services/notifications/apns/NotificationsServiceIT.java | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1e7da5c8/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java
b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java
index a057f31..c88cead 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java
@@ -61,7 +61,7 @@ public class ApplicationQueueManager implements QueueManager {
     private final JobScheduler jobScheduler;
     private final MetricsFactory metricsFactory;
     private final String[] queueNames;
-    private boolean sendNow = false;
+    private boolean sendNow = true;
 
     HashMap<Object, Notifier> notifierHashMap; // only retrieve notifiers once
 
@@ -131,6 +131,9 @@ public class ApplicationQueueManager implements QueueManager {
             final CountMinSketch sketch = new CountMinSketch(0.0001,.99,7364181); //add probablistic
counter to find dups
             final UUID appId = em.getApplication().getUuid();
             final Map<String,Object> payloads = notification.getPayloads();
+
+            final boolean sendNow = this.sendNow; //&& jobExecution == null;
+
             final Func1<Entity,Entity> entityListFunct = new Func1<Entity, Entity>()
{
                 @Override
                 public Entity call(Entity entity) {
@@ -180,7 +183,7 @@ public class ApplicationQueueManager implements QueueManager {
                                 LOG.info("ApplicationQueueMessage: notification {} device
{} queue time set. duration "+(System.currentTimeMillis()-now)+" ms", notification.getUuid(),
deviceRef.getUuid());
                             }
                             now = System.currentTimeMillis();
-                            if(jobExecution == null && sendNow) {
+                            if(sendNow){ //if(jobExecution == null && sendNow) {
                                 messages.add(message);
                             }else{
                                 qm.postToQueue(queueName, message);
@@ -249,7 +252,7 @@ public class ApplicationQueueManager implements QueueManager {
             LOG.info("ApplicationQueueMessage: notification {} done queuing to {} devices
in "+elapsed+" ms",notification.getUuid().toString(),deviceCount.get());
         }
 
-        if(sendNow && messages.size()>0){
+        if(messages.size()>0){
             now = System.currentTimeMillis();
             sendBatchToProviders(messages,null).toBlocking().lastOrDefault(null);
             LOG.info("ApplicationQueueMessage: notification {} done sending to "+messages.size()+"
devicess in {} ms", notification.getUuid(), System.currentTimeMillis() - now);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1e7da5c8/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
----------------------------------------------------------------------
diff --git a/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
b/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
index 479ca86..27e6d27 100644
--- a/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/services/notifications/apns/NotificationsServiceIT.java
@@ -181,7 +181,7 @@ public class NotificationsServiceIT extends AbstractServiceNotificationIT
{
 
         // verify Query for CREATED state
         Query query = new Query();
-        query.addEqualityFilter("state", Notification.State.STARTED.toString());
+        query.addEqualityFilter("state", Notification.State.FINISHED.toString());
         Results results = app.getEm().searchCollection(
                 app.getEm().getApplicationRef(), "notifications", query);
         Entity entity = results.getEntitiesMap().get(notification.getUuid());


Mime
View raw message