Skip to content

Commit

Permalink
Add aliases to abort controllers, change health-check return types to…
Browse files Browse the repository at this point in the history
… Any
  • Loading branch information
BAntonellini committed Sep 12, 2023
1 parent df0bc91 commit 761b07e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/features/helper/dbtInterface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import AbortController from "node-abort-controller";
import fetch, { Response } from "node-fetch";
import { AbortSignal } from "node-fetch/externals";

import Configuration from "./configuration";
import Utilities from "./utilities";
Expand Down Expand Up @@ -63,7 +64,7 @@ export class DbtInterface {
return url;
}

public async healthCheck(): Promise<boolean> {
public async healthCheck(): Promise<any> {
const abortController = new AbortController();
const timeoutHandler = setTimeout(() => {
abortController.abort();
Expand All @@ -73,7 +74,7 @@ export class DbtInterface {
`http://${Configuration.dbtInterfaceHost()}:${Configuration.dbtInterfacePort()}/health`,
{
method: "GET",
signal: abortController.signal,
signal: abortController.signal as AbortSignal
},
);
if (response.status === 200) {
Expand Down Expand Up @@ -127,7 +128,7 @@ export class DbtInterface {
encodeURI(this.getLintURL()),
{
method: "POST",
signal: abortController.signal,
signal: abortController.signal as AbortSignal,
body: this.sql,
},
);
Expand Down

0 comments on commit 761b07e

Please sign in to comment.