writeProtectionEvents appends the audit rows best-effort (deterministic ids make it idempotent, so writing outside any message tx is safe).
(ctx context.Context, messageID string, events []identity.ProtectionEvent)
| 259 | // writeProtectionEvents appends the audit rows best-effort (deterministic ids make |
| 260 | // it idempotent, so writing outside any message tx is safe). |
| 261 | func (a *API) writeProtectionEvents(ctx context.Context, messageID string, events []identity.ProtectionEvent) { |
| 262 | for _, ev := range events { |
| 263 | if err := a.store.CreateProtectionEvent(ctx, ev); err != nil { |
| 264 | log.Printf("[mail:%s] screening_event write failed (%s/%s): %v", messageID, ev.Source, ev.Reason, err) |
| 265 | } |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | // annotateAndAudit denormalizes the verdict onto the (already-created) message |
| 270 | // row and writes the audit rows. Used on the flag (sent) and review (held) paths |
no test coverage detected