Browse Source

Merge pull request #468 from gre/slower-intervals

tweak rates
master
Meriadec Pillet 7 years ago
committed by GitHub
parent
commit
f831c0dc65
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/bridge/BridgeSyncContext.js
  2. 3
      src/components/EnsureDeviceApp/index.js
  3. 6
      src/config/constants.js

5
src/bridge/BridgeSyncContext.js

@ -13,6 +13,7 @@ import {
} from 'reducers/bridgeSync'
import type { BridgeSyncState } from 'reducers/bridgeSync'
import { accountsSelector } from 'reducers/accounts'
import { SYNC_BOOT_DELAY, SYNC_INTERVAL } from 'config/constants'
import { getBridgeForCurrency } from '.'
// Unify the synchronization management for bridges with the redux store
@ -153,9 +154,9 @@ class Provider extends Component<BridgeSyncProviderOwnProps, BridgeSync> {
} catch (e) {
logger.error('sync issues', e)
}
setTimeout(syncLoop, 10 * 1000)
setTimeout(syncLoop, SYNC_INTERVAL)
}
setTimeout(syncLoop, 2 * 1000)
setTimeout(syncLoop, SYNC_BOOT_DELAY)
}
// TODO we might want to call sync straight away when new accounts got added (it will happen every 10s anyway)

3
src/components/EnsureDeviceApp/index.js

@ -11,8 +11,7 @@ import type { State as StoreState } from 'reducers/index'
import getAddress from 'commands/getAddress'
import isCurrencyAppOpened from 'commands/isCurrencyAppOpened'
const CHECK_APP_INTERVAL_WHEN_INVALID = 300
const CHECK_APP_INTERVAL_WHEN_VALID = 1000
import { CHECK_APP_INTERVAL_WHEN_VALID, CHECK_APP_INTERVAL_WHEN_INVALID } from 'config/constants'
type OwnProps = {
currency?: ?CryptoCurrency,

6
src/config/constants.js

@ -1,3 +1,9 @@
// @flow
export const SYNC_BOOT_DELAY = 5 * 1000
export const SYNC_INTERVAL = 30 * 1000
export const CHECK_APP_INTERVAL_WHEN_INVALID = 600
export const CHECK_APP_INTERVAL_WHEN_VALID = 1200
export const CHECK_UPDATE_DELAY = 5e3
export const MODAL_ADD_ACCOUNT = 'MODAL_ADD_ACCOUNT'

Loading…
Cancel
Save