Skip to content

HVC Services — Workers

  • Project: hvc-services

Email sender (Services/EmailSenderService.cs)

A BackgroundService that runs per environment (one per entry in the environments config array). Each instance:

  • Subscribes to OnNewEmail (via the in-process PubSub hub or from POST /Notify/email).
  • Batches emailOutboxEntries (batch size 20), handles retries/back-off (maxRetrySeconds, error sleep), and sends via the configured channel (Mailgun HTTP API or SMTP) — including .ics calendar attachments.
  • lastId/prevId track the cursor so only new entries are picked up.

Key tunables (in the service): batchSize = 20, sleepTimeMs = 500, errorSleepTimeMs = 1500, sqlErrorSleepTimeMs = 1800000, maxRetrySeconds = 120.

Recording downloader (Services/RecordingDownloaderService.cs)

A BackgroundService that:

  • Lists an Azure Blob container for finished recordings (*.mp4/*.xml).
  • Parses the filename convention env__eventId__tenantId__... to know where each file belongs.
  • Generates SAS URLs, copies the files into the tenant's storage (via Hvc.Storage), and inserts MediaFile + FileShare rows; sets hasRecording on the event.

Released under the MIT License.