Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

queryTimeout is broken #588

Open
dferber90 opened this issue Jan 16, 2022 · 0 comments
Open

queryTimeout is broken #588

dferber90 opened this issue Jan 16, 2022 · 0 comments

Comments

@dferber90
Copy link

When using the queryTimeout option, the promise returned by faunaClient.query(xxx, { queryTimeout: 30 }) never resolves.

This was my code in a Cloudflare Worker. The promise would simply never resolve.

const projectRef = q.Ref(q.Collection("Projects"), options.projectId);
await faunaClient
    .query<string | null>(
      q.If(
        q.Exists(projectRef),
        q.Select(["data", "flagsRevision"], q.Get(projectRef)),
        null
      ),
      { queryTimeout: 10 }
    )
    .catch((error) => {
      console.error("fauna error");
      console.error(error);
      return null;
    })

As a workaround, I used the signal option instead of the queryTimeout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant