Skip to content

HVC Sink Api — Workers

  • Project: hvc-sinkapi

Background processing (Services/DirectConferenceProcessorService.cs)

A BackgroundService that starts one conference processor plus one TenantConferenceSyncService per configured environment.

1. DirectConferenceProcessor (Services/DirectConferenceProcessor.cs)

Main loop:

  • Fetches finished conferences from Pexip (paginated, ordered by end time).
  • Matches them to assigned rooms (configurable matching strategy, e.g. nearest).
  • Builds the tenant SQL (participant logs + event completion) and admin SQL (Meetings, MeetingParticipants).
  • Writes a pexipDataEntries row that carries the generated SQL for later execution, then resets the room assignment.

2. TenantConferenceSyncService (Features/PexipDataLoader/TenantConferenceSyncService.cs)

  • Polls pexipDataEntries and dispatches each entry to a per-tenant Channel.
  • One runner per tenant executes the generated SQL against that tenant's DB (filling in hasChat, numberOfAttachments from live counts).

Cleanup (Services/CleanupService.cs)

Scans for rooms that were assigned (assignedOn != null, eventId > 0) but never saw a matching conference, and either processes or clears them:

  • update virtualMeetingRooms set assignedOn = null, eventId = 0 ... for stale rooms.
  • Triggered manually via POST /api/Cleanup/scan?environment=... and periodically by the processor. Tracks counters in the shared ProcessingStatus.

Released under the MIT License.