mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
fix refs
This commit is contained in:
parent
7e9ed704cc
commit
f499af5491
3 changed files with 32 additions and 14 deletions
11
lib/kafka.js
11
lib/kafka.js
|
|
@ -44,18 +44,18 @@ let kafkaProducer = null;
|
|||
|
||||
export { kafka, kafkaProducer };
|
||||
|
||||
export async function getProducer() {
|
||||
async function getProducer() {
|
||||
const producer = kafka.producer();
|
||||
await producer.connect();
|
||||
|
||||
return producer;
|
||||
}
|
||||
|
||||
export function getDateFormat(date) {
|
||||
function getDateFormat(date) {
|
||||
return dateFormat(date, 'UTC:yyyy-mm-dd HH:MM:ss');
|
||||
}
|
||||
|
||||
export async function sendMessage(params, topic) {
|
||||
async function sendMessage(params, topic) {
|
||||
await kafkaProducer.send({
|
||||
topic,
|
||||
messages: [
|
||||
|
|
@ -67,3 +67,8 @@ export async function sendMessage(params, topic) {
|
|||
acks: 0,
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
getDateFormat,
|
||||
sendMessage,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue