Add hidden setting to set taskTimerInterval, add documentation (#4523)

* Add sync filter hidden setting documentation

* Add setting to change the taskTimerInterval

* Add documentation for the saver filter hidden setting

* add hidden setting for timerTaskInterval, add documentation for timerTaskInterval, saver filter and sync filter
fix-syncer
jed 2020-04-02 20:49:09 +02:00 zatwierdzone przez GitHub
rodzic 980f337549
commit 840a5951be
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 41 dodań i 10 usunięć

Wyświetl plik

@ -24,6 +24,7 @@ Syncer.prototype.titleSyncPollingInterval = "$:/config/SyncPollingInterval";
Syncer.prototype.titleSyncDisableLazyLoading = "$:/config/SyncDisableLazyLoading";
Syncer.prototype.titleSavedNotification = "$:/language/Notifications/Save/Done";
Syncer.prototype.titleSyncThrottleInterval = "$:/config/SyncThrottleInterval";
Syncer.prototype.titleTaskTimerInterval = "$:/config/TaskTimerInterval"
Syncer.prototype.taskTimerInterval = 1 * 1000; // Interval for sync timer
Syncer.prototype.throttleInterval = 1 * 1000; // Defer saving tiddlers if they've changed in the last 1s...
Syncer.prototype.errorRetryInterval = 5 * 1000; // Interval to retry after an error
@ -45,7 +46,7 @@ function Syncer(options) {
this.titleUserName = options.titleUserName || this.titleUserName;
this.titleSyncFilter = options.titleSyncFilter || this.titleSyncFilter;
this.titleSavedNotification = options.titleSavedNotification || this.titleSavedNotification;
this.taskTimerInterval = options.taskTimerInterval || this.taskTimerInterval;
this.taskTimerInterval = options.taskTimerInterval || parseInt(this.wiki.getTiddlerText(this.titleTaskTimerInterval,""),10) || this.taskTimerInterval;
this.throttleInterval = options.throttleInterval || parseInt(this.wiki.getTiddlerText(this.titleSyncThrottleInterval,""),10) || this.throttleInterval;
this.errorRetryInterval = options.errorRetryInterval || this.errorRetryInterval;
this.fallbackInterval = options.fallbackInterval || this.fallbackInterval;
@ -83,7 +84,7 @@ function Syncer(options) {
if(filteredChanges.length > 0) {
self.processTaskQueue();
} else {
// Look for deletions of tiddlers we're already syncing
// Look for deletions of tiddlers we're already syncing
var outstandingDeletion = false
$tw.utils.each(changes,function(change,title,object) {
if(change.deleted && $tw.utils.hop(self.tiddlerInfo,title)) {
@ -124,7 +125,7 @@ function Syncer(options) {
if(!this.disableUI && $tw.wiki.getTiddlerText(this.titleSyncDisableLazyLoading) !== "yes") {
this.wiki.addEventListener("lazyLoad",function(title) {
self.handleLazyLoadEvent(title);
});
});
}
// Get the login status
this.getStatus(function(err,isLoggedIn) {
@ -155,8 +156,8 @@ Syncer.prototype.getTiddlerRevision = function(title) {
if(this.syncadaptor && this.syncadaptor.getTiddlerRevision) {
return this.syncadaptor.getTiddlerRevision(title);
} else {
return this.wiki.getTiddler(title).fields.revision;
}
return this.wiki.getTiddler(title).fields.revision;
}
};
/*
@ -307,7 +308,7 @@ Syncer.prototype.syncFromServer = function() {
});
if(updates.modifications.length > 0 || updates.deletions.length > 0) {
self.processTaskQueue();
}
}
}
});
} else if(this.syncadaptor && this.syncadaptor.getSkinnyTiddlers) {
@ -475,7 +476,7 @@ Syncer.prototype.processTaskQueue = function() {
} else {
self.updateDirtyStatus();
// Process the next task
self.processTaskQueue.call(self);
self.processTaskQueue.call(self);
}
});
} else {
@ -483,11 +484,11 @@ Syncer.prototype.processTaskQueue = function() {
this.updateDirtyStatus();
// And trigger a timeout if there is a pending task
if(task === true) {
this.triggerTimeout();
this.triggerTimeout();
}
}
} else {
this.updateDirtyStatus();
this.updateDirtyStatus();
}
};
@ -521,7 +522,7 @@ Syncer.prototype.chooseNextTask = function() {
isReadyToSave = !tiddlerInfo || !tiddlerInfo.timestampLastSaved || tiddlerInfo.timestampLastSaved < thresholdLastSaved;
if(hasChanged) {
if(isReadyToSave) {
return new SaveTiddlerTask(this,title);
return new SaveTiddlerTask(this,title);
} else {
havePending = true;
}

Wyświetl plik

@ -0,0 +1,10 @@
title: Hidden Setting: Saver Filter
tags: [[Hidden Settings]]
A filter which determines which tiddlers should be saved when saving the wiki.
Defaults to "" which saves everything.
Changing needs a restart to take effect.
$:/config/SaverFilter

Wyświetl plik

@ -0,0 +1,10 @@
title: Hidden Setting: Sync Filter
tags: [[Hidden Settings]]
A filter which determines which tiddlers in the wiki should be synced with the server.
Defaults to "" which syncs everything.
Changing needs a restart to take effect.
$:/config/SyncFilter

Wyświetl plik

@ -0,0 +1,10 @@
title: Hidden Setting: Task Timer Interval
tags: [[Hidden Settings]]
Specifies the interval at which [[Syncadaptor|https://tiddlywiki.com/dev/#Syncadaptor]] will run the next task in the queue.
Defaults to "1000" (1 * 1000ms = 1s)
Changing needs a restart to take effect.
$:/config/TaskTimerInterval