Skip to content

Commit

Permalink
Fix race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Kida committed Dec 14, 2017
1 parent aae6024 commit 429f79b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DeveloperExcuses/DeveloperExcuses-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
<string>2.1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.1.0</string>
<string>2.1.1</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Marcus Kida. All rights reserved.</string>
<key>NSPrincipalClass</key>
Expand Down
4 changes: 2 additions & 2 deletions DeveloperExcuses/DeveloperExcusesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class DeveloperExcusesView: ScreenSaverView {
return
}
fetchingDue = false
fetchQueue.async { [weak self] in
fetchQueue.sync { [weak self] in
guard let data = try? Data(contentsOf: .websiteUrl), let string = String(data: data, encoding: .utf8) else {
return
}
Expand All @@ -135,7 +135,7 @@ class DeveloperExcusesView: ScreenSaverView {
return (string as NSString).substring(with: result.range(at: 1))
}

self?.mainQueue.sync { [weak self] in
self?.mainQueue.async { [weak self] in
self?.lastFetchDate = Date()
self?.scheduleNext()
self?.set(quote: quotes.first)
Expand Down
Binary file modified Release/DeveloperExcuses.saver.zip
Binary file not shown.

0 comments on commit 429f79b

Please sign in to comment.