(ctx context.Context, invocationUUID uuid.UUID, event SyncFinishedEvent)
| 184 | } |
| 185 | |
| 186 | func TrackSyncCompleted(ctx context.Context, invocationUUID uuid.UUID, event SyncFinishedEvent) { |
| 187 | if client == nil { |
| 188 | return |
| 189 | } |
| 190 | |
| 191 | details := getSyncEventDetails(ctx) |
| 192 | if details == nil { |
| 193 | return |
| 194 | } |
| 195 | |
| 196 | if details.isCurrentTeamInternal { |
| 197 | return |
| 198 | } |
| 199 | |
| 200 | status := "success" |
| 201 | if event.AbortedDueToError != nil { |
| 202 | status = "error" |
| 203 | } |
| 204 | |
| 205 | props := getSyncCommonProps(invocationUUID, event.SyncStartedEvent, details). |
| 206 | Set("duration", event.Duration). |
| 207 | Set("status", status). |
| 208 | Set("total_rows", event.ResourceCount). |
| 209 | Set("errors", event.Errors). |
| 210 | Set("warnings", event.Warnings). |
| 211 | Set("aborted_due_to_error", event.AbortedDueToError) |
| 212 | |
| 213 | _ = client.Enqueue(rudderstack.Track{ |
| 214 | UserId: details.user.ID.String(), |
| 215 | Event: "sync_run_completed", |
| 216 | Properties: props, |
| 217 | }) |
| 218 | } |
| 219 | |
| 220 | type InitEvent struct { |
| 221 | Source string |
nothing calls this directly
no test coverage detected