Meriadec Pillet
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
10 additions and
4 deletions
-
src/bridge/BridgeSyncContext.js
-
src/components/EnsureDeviceApp/index.js
-
src/config/constants.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)
|
|
|
|
|
|
@ -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, |
|
|
|
|
|
@ -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' |
|
|
|