This is an automated email from the git hooks/post-receive script. New commit to branch feature/sync in repository jtimer. See https://gitlab.nuiton.org/chorem/jtimer.git commit 09a46c6a29ec59af2f0ba6ebae8b12a75354c4da Author: servantie <servantie.c@gmail.com> Date: Fri Jun 3 09:52:06 2016 +0200 corrected the json creation to deal with times added before the task's creation date (and be able to send them, that way) corrected the url creation in the synchronization --- src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java | 2 +- src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java index c5a2a77..f2ed4a8 100644 --- a/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java +++ b/src/main/java/org/chorem/jtimer/entities/TimerTaskHelper.java @@ -342,7 +342,7 @@ public class TimerTaskHelper { * @return result the string in JSON */ public static JsonObject taskToJSONFormat(TimerTask task, boolean withAnnotations) { - Date startDate = task.getCreationDate(); + Date startDate = task.getAllDaysAndTimes().firstKey(); Date endDate = new Date(); JsonObject resultingJSON = taskToJSONFormat(task, startDate, endDate, withAnnotations); return resultingJSON; diff --git a/src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java b/src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java index 05e716a..95b995d 100644 --- a/src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java +++ b/src/main/java/org/chorem/jtimer/io/TimerTaskSynchronizer.java @@ -26,7 +26,7 @@ public class TimerTaskSynchronizer implements DataEventListener { private static Log log = LogFactory.getLog(TimerTaskSynchronizer.class); /** auto sync delay */ - protected int autoSyncDelay = 1000 * 60; //1min for testing purposes + protected int autoSyncDelay = 1000 * 10; //10 s for testing purposes /** timer to schedule syncs */ protected Timer timer; @@ -78,13 +78,14 @@ public class TimerTaskSynchronizer implements DataEventListener { synchronized (tasksToSync) { Collection<TimerTask> remainingTasks = new ArrayList<>(tasksToSync); for (TimerTask task : tasksToSync) { + if (log.isDebugEnabled()){ + log.debug("task " + task.getName() + " being synced."); + } //do the sync, store the result boolean syncDone = synchronizeSingleTask(task); if (remainingTasks.contains(task)) { remainingTasks.remove(task); } - log.info(" task synced : " + syncDone); - } tasksToSync = remainingTasks; @@ -109,7 +110,7 @@ public class TimerTaskSynchronizer implements DataEventListener { HttpURLConnection connection = null; URL url = null; try { - url = new URL("http://" + syncURl); + url = new URL(syncURl); } catch (MalformedURLException e) { e.printStackTrace(); } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.