Skip to content

Commit

Permalink
fix(firestore-bigquery-export): update event types for Eventarc compa…
Browse files Browse the repository at this point in the history
…tibility (#1981)
  • Loading branch information
Gustolandia committed Dec 20, 2024
1 parent 5a9311b commit aa614f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions firestore-bigquery-export/functions/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const setupEventChannel = () => {
* @returns A Promise resolving when both events are published.
*/
export const recordStartEvent = async (data: string | object) => {
if (!eventChannel) return;
if (!eventChannel) return Promise.resolve(); // Explicitly return a resolved Promise

const eventTypes = getEventTypes("onStart");

Expand All @@ -72,7 +72,7 @@ export const recordStartEvent = async (data: string | object) => {
* @returns A Promise resolving when both events are published.
*/
export const recordErrorEvent = async (err: Error, subject?: string) => {
if (!eventChannel) return;
if (!eventChannel) return Promise.resolve(); // Ensure consistent return type

const eventTypes = getEventTypes("onError");

Expand Down Expand Up @@ -103,7 +103,7 @@ export const recordSuccessEvent = async ({
subject: string;
data: string | object;
}) => {
if (!eventChannel) return;
if (!eventChannel) return Promise.resolve(); // Explicitly return a resolved Promise

const eventTypes = getEventTypes("onSuccess");

Expand All @@ -126,7 +126,7 @@ export const recordSuccessEvent = async ({
* @returns A Promise resolving when both events are published.
*/
export const recordCompletionEvent = async (data: string | object) => {
if (!eventChannel) return;
if (!eventChannel) return Promise.resolve(); // Ensure consistent return type

const eventTypes = getEventTypes("onCompletion");

Expand Down

0 comments on commit aa614f5

Please sign in to comment.