Skip to content

Commit

Permalink
🔀 Merge branch 'yann/fix/lekaupdater/adjust-delays-before-writing-cha…
Browse files Browse the repository at this point in the history
…racteristics'
  • Loading branch information
ladislas committed Sep 25, 2023
2 parents 68cdb86 + 1e08742 commit 04a7fc3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private class StateSettingDestinationPath: GKState, StateEventProcessor {
}

override func didEnter(from previousState: GKState?) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: setDestinationPath)
DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: setDestinationPath)
}

func process(event: UpdateEvent) {
Expand Down Expand Up @@ -169,7 +169,7 @@ private class StateSendingFile: GKState, StateEventProcessor {
}

override func didEnter(from previousState: GKState?) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: sendFile)
DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: sendFile)
}

override func willExit(to nextState: GKState) {
Expand Down Expand Up @@ -198,7 +198,7 @@ private class StateSendingFile: GKState, StateEventProcessor {

private func tryToSendNextPacket() {
if isInCriticalSection() {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: self.tryToSendNextPacket)
DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: self.tryToSendNextPacket)
return
}

Expand Down Expand Up @@ -244,8 +244,8 @@ private class StateApplyingUpdate: GKState, StateEventProcessor {

override func didEnter(from previousState: GKState?) {

DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: setMajorMinorRevision)
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0, execute: applyUpdate)
DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: setMajorMinorRevision)
DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: applyUpdate)

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private class StateSettingFileExchangeState: GKState, StateEventProcessor {
}

override func didEnter(from previousState: GKState?) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: setFileExchangeState)
DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: setFileExchangeState)
}

func process(event: UpdateEvent) {
Expand Down Expand Up @@ -123,7 +123,7 @@ private class StateSettingDestinationPath: GKState, StateEventProcessor {
}

override func didEnter(from previousState: GKState?) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: setDestinationPath)
DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: setDestinationPath)
}

func process(event: UpdateEvent) {
Expand Down Expand Up @@ -164,7 +164,7 @@ private class StateClearingFile: GKState, StateEventProcessor {
}

override func didEnter(from previousState: GKState?) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: setClearPath)
DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: setClearPath)
}

func process(event: UpdateEvent) {
Expand Down Expand Up @@ -247,7 +247,7 @@ private class StateSendingFile: GKState, StateEventProcessor {
}

override func didEnter(from previousState: GKState?) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: sendFile)
DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: sendFile)
}

override func willExit(to nextState: GKState) {
Expand Down Expand Up @@ -393,8 +393,8 @@ private class StateApplyingUpdate: GKState, StateEventProcessor {

override func didEnter(from previousState: GKState?) {

DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: setMajorMinorRevision)
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0, execute: applyUpdate)
DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: setMajorMinorRevision)
DispatchQueue.main.asyncAfter(deadline: .now() + 2, execute: applyUpdate)

}

Expand Down

0 comments on commit 04a7fc3

Please sign in to comment.