[Help] If it is possible to achieve scheduled synchronization? #362
Unanswered
opacscdbph44
asked this question in
Q&A
Replies: 1 comment
-
This script will run a sync every 30 minutes. Use the // Define the interval in milliseconds (30 minutes = 1800000 milliseconds)
const syncInterval = 30 * 60 * 1000; // 30 minutes
// Function to perform manual synchronization
function performSync() {
Zotero.debug("Performing timed synchronization...");
try {
Zotero.Sync.Runner.sync(); // Correct method to trigger sync
Zotero.debug("Synchronization complete.");
} catch (error) {
Zotero.logError(`Error during synchronization: ${error.message}`);
}
}
// Set up a timed sync using setInterval
function startTimedSync() {
Zotero.debug(`Setting timed synchronization to every ${syncInterval / 60000} minutes.`);
// Perform the first sync immediately
performSync();
// Set up recurring sync every syncInterval (30 minutes)
setInterval(performSync, syncInterval);
}
// Run the timed sync function at program startup
Zotero.debug("Timed sync script triggered at program startup.");
startTimedSync(); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
With the increase in the number of items, automatic synchronization often lags in zotero 7.0.1, and even sometimes crashs, but not happen with manual synchronization. If it is possible to write an automatic script to achieve timed synchronization, for example, i.e. set to synchronize every 30 minutes, rather than at the zotero starts and every time there is a change.
随着条目数量增多,在开启自动同步的情况下,启动zotero时通常十分卡顿,甚至有时会卡死。当使用手动同步则不会出现类似情况。请问各位大佬,是否有可能实现定时执行的同步,而不是在软件启动和每次有改动时都同步(例如自己可以设定每30分钟同步一次),十分感谢!
Beta Was this translation helpful? Give feedback.
All reactions