Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #37 from akuzminskyi/feature/ak/fixed-unstored-events
Browse files Browse the repository at this point in the history
Fixed unstored events
  • Loading branch information
albertodebortoli authored Jan 4, 2022
2 parents 10af9c9 + 88fe024 commit 3f1d5f9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions JustTrack/Classes/JustTrack/Operations/TrackOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ class TrackOperation: Operation {
self.tracker = tracker
self.eventKey = "\(event.name)_ON_\(tracker.name)_\(Date().timeIntervalSince1970)"
super.init()

// Persist the event.
saveEvent(event, key: eventKey)
}

// MARK: - Operation lifecycle

override func main() {
guard !isCancelled else { return }

// Persist the event.
// Delete it before posting if the operation was cancelled while persisting the event.
saveEvent(event, key: eventKey)
guard !isCancelled else {
deleteEvent(eventKey)
return
Expand Down

0 comments on commit 3f1d5f9

Please sign in to comment.