1
0
Fork 0
mirror of synced 2024-06-29 11:31:06 +12:00

Rename async to emit

This commit is contained in:
Rory Powell 2022-08-09 14:01:55 +01:00
parent cf37563c89
commit 1a31dff984
3 changed files with 4 additions and 4 deletions

View file

@ -2,17 +2,17 @@ import { Event } from "@budibase/types"
import { processors } from "./processors"
import * as identification from "./identification"
import * as backfill from "./backfill"
import { emitter, EmittedEvent } from "./async"
import { emitter, EmittedEvent } from "./emit"
import * as context from "../context"
import * as logging from "../logging"
const USE_ASYNC: any[] = [
const USE_EMITTER: any[] = [
Event.SERVED_BUILDER,
Event.SERVED_APP,
Event.SERVED_APP_PREVIEW,
]
for (let event of USE_ASYNC) {
for (let event of USE_EMITTER) {
emitter.on(event, async (props: EmittedEvent) => {
try {
await context.doInTenant(props.tenantId, async () => {
@ -46,7 +46,7 @@ export const publishEvent = async (
// in future this should use async events via a distributed queue.
const identity = await identification.getCurrentIdentity()
if (USE_ASYNC.includes(event)) {
if (USE_EMITTER.includes(event)) {
emitter.emitEvent(event, properties, identity)
return
}