Skip to content

Commit

Permalink
Merge pull request #171 from czechboy0/hd/fix_sync_interval
Browse files Browse the repository at this point in the history
Fixed sync interval not being changed live
  • Loading branch information
czechboy0 committed Oct 13, 2015
2 parents 6dd63dc + 6011093 commit 97aaaef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions BuildaKit/HDGitHubXCBotSyncer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public class HDGitHubXCBotSyncer : Syncer {
self.triggers = triggers

super.init(syncInterval: config.syncInterval)

self.config.producer.startWithNext { [weak self] in
self?.syncInterval = $0.syncInterval
}
}

deinit {
Expand Down
2 changes: 1 addition & 1 deletion BuildaKit/Syncer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Trampoline: NSObject {
private var currentSyncError: NSError?

/// How often, in seconds, the syncer should pull data from both sources and resolve pending actions
public let syncInterval: NSTimeInterval
public var syncInterval: NSTimeInterval

private var isSyncing: Bool {
didSet {
Expand Down

0 comments on commit 97aaaef

Please sign in to comment.