mirror of https://github.com/buster-so/buster.git
Fix BigQuery Job.cancel() return type compatibility - change interface from Promise<void> to Promise<unknown> to match actual CancelResponse return type
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
This commit is contained in:
parent
4f633a0eac
commit
1d06ae1c47
|
@ -10,7 +10,7 @@ import { type AdapterQueryResult, BaseAdapter, type FieldMetadata } from './base
|
||||||
class BigQueryCancellableQuery implements CancellableQuery<AdapterQueryResult> {
|
class BigQueryCancellableQuery implements CancellableQuery<AdapterQueryResult> {
|
||||||
private cancelled = false;
|
private cancelled = false;
|
||||||
private controller = new BaseCancellationController();
|
private controller = new BaseCancellationController();
|
||||||
private job?: unknown;
|
private job?: { cancel(): Promise<unknown> };
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private client: BigQuery,
|
private client: BigQuery,
|
||||||
|
@ -66,7 +66,7 @@ class BigQueryCancellableQuery implements CancellableQuery<AdapterQueryResult> {
|
||||||
this.controller.onCancellation(async () => {
|
this.controller.onCancellation(async () => {
|
||||||
if (this.job) {
|
if (this.job) {
|
||||||
try {
|
try {
|
||||||
await (this.job as any).cancel();
|
await this.job.cancel();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn('BigQuery job cancellation warning:', error);
|
console.warn('BigQuery job cancellation warning:', error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue