summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorniko <niko>2012-07-04 12:15:10 (GMT)
committerniko <niko>2012-07-04 12:15:10 (GMT)
commitea548d5bd53857d78c84fc7d623e797fa3a8a9c5 (patch)
tree8590865230c8aeca8ebdb12d540958889fc3ff61
parent183420f033a9f1fd4366c80943ba39c9e758b4a1 (diff)
downloadsynckolab-ea548d5bd53857d78c84fc7d623e797fa3a8a9c5.tar.gz
#24954
-rw-r--r--src/chrome/content/synckolab/synckolab.js23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/chrome/content/synckolab/synckolab.js b/src/chrome/content/synckolab/synckolab.js
index 3e92c01..f7a0054 100644
--- a/src/chrome/content/synckolab/synckolab.js
+++ b/src/chrome/content/synckolab/synckolab.js
@@ -36,6 +36,7 @@ if(!com.synckolab) com.synckolab={};
//synckolab interface
com.synckolab.main = {
timer: Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer),
+ backgroundTimer: Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer),
/************************
* Global Variables
*/
@@ -58,12 +59,12 @@ com.synckolab.main = {
* runs periodically and checks if there is anything to do
*/
com.synckolab.main.syncKolabTimer = function () {
-/*@deprecated: listener works better
- com.synckolab.tools.logMessage("sync timer: check configuration", com.synckolab.global.LOG_DEBUG);
- var i;
+ com.synckolab.tools.logMessage("sync timer starting", com.synckolab.global.LOG_DEBUG);
+ com.synckolab.config.readConfiguration();
+ /*@deprecated: listener works better
+ var i;
// check and load config
- com.synckolab.config.readConfiguration();
// only continue timer if nothing is running right now and if we have any configs!
if (com.synckolab.main.forceConfig === null && com.synckolab.main.syncConfigs)
@@ -109,11 +110,13 @@ com.synckolab.main.syncKolabTimer = function () {
for(var j = 0; j < com.synckolab.main.syncConfigs.length; j++) {
if(com.synckolab.main.syncConfigs[j]) {
var curConfig = com.synckolab.main.syncConfigs[j];
+ com.synckolab.tools.logMessage("sync timer: checking config " + curConfig.name, com.synckolab.global.LOG_DEBUG);
+
if(curConfig.syncListener && curConfig.folder)
{
com.synckolab.tools.logMessage("refreshing " + curConfig.folderMsgURI + "...", com.synckolab.global.LOG_DEBUG);
try {
- curConfig.folder.updateFolder();
+ curConfig.folder.updateFolder(null);
} catch (ex) {
com.synckolab.tools.logMessage("unable to refresh " + curConfig.folderMsgURI + ": " + ex, com.synckolab.global.LOG_WARNING);
}
@@ -123,8 +126,14 @@ com.synckolab.main.syncKolabTimer = function () {
}
// wait a minute
- com.synckolab.tools.logMessage("sync timer: sleep for one minute", com.synckolab.global.LOG_DEBUG);
- com.synckolab.main.timer.initWithCallback({notify:function (){com.synckolab.main.syncKolabTimer();}}, 60000, 0);
+ com.synckolab.tools.logMessage("sync timer: sleep for 30s minute", com.synckolab.global.LOG_INFO);
+
+ com.synckolab.main.backgroundTimer.initWithCallback({
+ notify:
+ function () {
+ com.synckolab.main.syncKolabTimer();
+ }
+ }, 30000, 0);
};
com.synckolab.main.initGroupwareActions = function() {