delayedCancelKey returns the Redis key that, if set, means this delayed notification should be suppressed.
(ev Event)
| 453 | |
| 454 | // delayedCancelKey returns the Redis key that, if set, means this delayed notification should be suppressed. |
| 455 | func delayedCancelKey(ev Event) string { |
| 456 | refID := ev.ReferenceID |
| 457 | if refID == "" { |
| 458 | refID = metadataString(ev.Metadata, "host_id") |
| 459 | } |
| 460 | if refID == "" { |
| 461 | return "" |
| 462 | } |
| 463 | return fmt.Sprintf("notif:cancel:%s:%s", ev.Type, refID) |
| 464 | } |
| 465 | |
| 466 | // IsDelayedCancelled checks if a delayed notification has been cancelled by a counterpart event. |
| 467 | func IsDelayedCancelled(rdb *redis.Client, tenantHost, cancelKey string) bool { |