mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-08 05:34:23 +08:00
Move SyncPolicy out of nylas-core to DefaultSyncPolicy
This commit is contained in:
parent
106d7e57a1
commit
65fafc0390
4 changed files with 13 additions and 19 deletions
11
packages/local-sync/src/local-api/default-sync-policy.js
Normal file
11
packages/local-sync/src/local-api/default-sync-policy.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
const DefaultSyncPolicy = {
|
||||
afterSync: 'idle',
|
||||
intervals: {
|
||||
active: 30 * 1000,
|
||||
inactive: 5 * 60 * 1000,
|
||||
},
|
||||
folderSyncOptions: {
|
||||
deepFolderScan: 10 * 60 * 1000,
|
||||
},
|
||||
}
|
||||
module.exports = DefaultSyncPolicy;
|
|
@ -6,10 +6,10 @@ const OAuth2 = google.auth.OAuth2;
|
|||
const Serialization = require('../serialization');
|
||||
const {
|
||||
IMAPConnection,
|
||||
SyncPolicy,
|
||||
Provider,
|
||||
Errors,
|
||||
} = require('nylas-core');
|
||||
const DefaultSyncPolicy = require('../default-sync-policy')
|
||||
const LocalDatabaseConnector = require('../../shared/local-database-connector')
|
||||
const LocalPubsubConnector = require('../../shared/local-pubsub-connector')
|
||||
|
||||
|
@ -62,7 +62,7 @@ const buildAccountWith = ({name, email, provider, settings, credentials}) => {
|
|||
provider: provider,
|
||||
emailAddress: email,
|
||||
connectionSettings: settings,
|
||||
syncPolicy: SyncPolicy.defaultPolicy(),
|
||||
syncPolicy: DefaultSyncPolicy,
|
||||
lastSyncCompletions: [],
|
||||
})
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ module.exports = {
|
|||
},
|
||||
Imap: require('imap'),
|
||||
IMAPConnection: require('./imap-connection'),
|
||||
SyncPolicy: require('./sync-policy'),
|
||||
MessageTypes: require('./message-types'),
|
||||
Logger: require('./logger'),
|
||||
Errors: require('./imap-errors'),
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
class SyncPolicy {
|
||||
static defaultPolicy() {
|
||||
return {
|
||||
afterSync: 'idle',
|
||||
intervals: {
|
||||
active: 30 * 1000,
|
||||
inactive: 5 * 60 * 1000,
|
||||
},
|
||||
folderSyncOptions: {
|
||||
deepFolderScan: 10 * 60 * 1000,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SyncPolicy
|
Loading…
Add table
Reference in a new issue