mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-29 21:15:06 +02:00
22 lines
549 B
TypeScript
22 lines
549 B
TypeScript
import { MeasureMetricsContext, type WorkspaceUuid } from '@hcengineering/core'
|
|
import { getPlatformQueue } from '@hcengineering/kafka'
|
|
import config from './config'
|
|
|
|
export async function SendTimeEvent (
|
|
ctx: MeasureMetricsContext,
|
|
ws: WorkspaceUuid,
|
|
topic: string,
|
|
data: any
|
|
): Promise<void> {
|
|
const SERVICE_NAME = 'time-machine'
|
|
const queue = getPlatformQueue(SERVICE_NAME, config.QueueRegion)
|
|
|
|
const producer = queue.getProducer<any>(ctx, topic as any)
|
|
|
|
await producer.send(ctx, ws, [data])
|
|
}
|
|
|
|
export default {
|
|
SendTimeEvent
|
|
}
|