Fix poll interval and cut it to half (#54)

This commit is contained in:
Francisco Gindre 2019-12-19 10:05:06 -03:00 committed by GitHub
parent 85ec6b1f95
commit 343507b565
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -371,7 +371,7 @@ public class CompactBlockProcessor {
private func processingFinished(height: BlockHeight) {
self.state = .synced
NotificationCenter.default.post(name: Notification.Name.blockProcessorFinished, object: self, userInfo: [CompactBlockProcessorNotificationKey.latestScannedBlockHeight : height])
self.backoffTimer = Timer(timeInterval: TimeInterval(self.config.blockPollInterval), repeats: true, block: { _ in
self.backoffTimer = Timer(timeInterval: self.config.blockPollInterval, repeats: true, block: { _ in
do {
try self.start()
} catch {

View File

@ -45,10 +45,10 @@ public let EXPIRY_OFFSET = 20
public let DEFAULT_BATCH_SIZE = 100
/**
* Default amount of time, in milliseconds, to poll for new blocks. Typically, this should be about half the average
* Default amount of time, in in seconds, to poll for new blocks. Typically, this should be about half the average
* block time.
*/
public let DEFAULT_POLL_INTERVAL: UInt64 = 75_000
public let DEFAULT_POLL_INTERVAL: TimeInterval = 37.5
/**
* Default attempts at retrying.