Skip to content

feat: disable dead subscribers #67

Description

@wa0x6e

Subscribers (http and discord) can both die.

  • A request to a dead http endpoint will either time out, or reject immediately
  • A dead discord (channel removed, permissions issues) will return an error by the discord API

In the case of timeout, connection will be open until timeout, so it's holding a TCP connection open for 30s (or whatever the timeout is set to) open, for nothing.

We should have a strategy to disable dead subscribers.

  • Add a status column in the subscribers/subscriptions table
  • Everyone has status ALIVE by default
  • Add a last_alive column in the subscribers/subscriptions table
  • Touch that column on success request
  • Each time we send a request, and it fails, we check that column and see for how long it was dead.
  • If dead for more than X days, we mark the subscriber as dead (update status to DEAD)
  • We send webhook events only to alive subscribers

This strategy will avoid wasting resources on dead subscribers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions