Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const poll = () => {
if (!this.isOpen) {
resolve({ status: QueryResponseStatus.Done, rows: [] });
} else {
const pollrc = this.nativeDb.pollConcurrentQuery(postrc.taskId);
if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Done)
resolve({ status: QueryResponseStatus.Done, rows: JSON.parse(pollrc.result, reviver) });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Partial)
resolve({ status: QueryResponseStatus.Partial, rows: JSON.parse(pollrc.result, reviver) });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Timeout)
resolve({ status: QueryResponseStatus.Timeout, rows: [] });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Pending)
setTimeout(() => { poll(); }, IModelHost.configuration!.concurrentQuery.pollInterval);
else
resolve({ status: QueryResponseStatus.Error, rows: [pollrc.result] });
}
};
setTimeout(() => { poll(); }, IModelHost.configuration!.concurrentQuery.pollInterval);
return new Promise((resolve) => {
const postrc = this.nativeDb.postConcurrentQuery(ecsql, JSON.stringify(bindings, replacer), limit!, quota!, priority!);
if (postrc.status !== IModelJsNative.ConcurrentQuery.PostStatus.Done)
resolve({ status: QueryResponseStatus.PostError, rows: [] });
const poll = () => {
if (!this.nativeDb || !this.nativeDb.isOpen()) {
resolve({ status: QueryResponseStatus.Done, rows: [] });
} else {
const pollrc = this.nativeDb.pollConcurrentQuery(postrc.taskId);
if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Done)
resolve({ status: QueryResponseStatus.Done, rows: JSON.parse(pollrc.result, reviver) });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Partial)
resolve({ status: QueryResponseStatus.Partial, rows: JSON.parse(pollrc.result, reviver) });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Timeout)
resolve({ status: QueryResponseStatus.Timeout, rows: [] });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Pending)
setTimeout(() => { poll(); }, IModelHost.configuration!.concurrentQuery.pollInterval);
else
const poll = () => {
if (!this.nativeDb || !this.nativeDb.isOpen()) {
resolve({ status: QueryResponseStatus.Done, rows: [] });
} else {
const pollrc = this.nativeDb.pollConcurrentQuery(postrc.taskId);
if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Done)
resolve({ status: QueryResponseStatus.Done, rows: JSON.parse(pollrc.result, reviver) });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Partial)
resolve({ status: QueryResponseStatus.Partial, rows: JSON.parse(pollrc.result, reviver) });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Timeout)
resolve({ status: QueryResponseStatus.Timeout, rows: [] });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Pending)
setTimeout(() => { poll(); }, IModelHost.configuration!.concurrentQuery.pollInterval);
else
resolve({ status: QueryResponseStatus.Error, rows: [pollrc.result] });
}
};
setTimeout(() => { poll(); }, IModelHost.configuration!.concurrentQuery.pollInterval);
const poll = () => {
if (!this.isOpen) {
resolve({ status: QueryResponseStatus.Done, rows: [] });
} else {
const pollrc = this.nativeDb.pollConcurrentQuery(postrc.taskId);
if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Done)
resolve({ status: QueryResponseStatus.Done, rows: JSON.parse(pollrc.result, reviver) });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Partial)
resolve({ status: QueryResponseStatus.Partial, rows: JSON.parse(pollrc.result, reviver) });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Timeout)
resolve({ status: QueryResponseStatus.Timeout, rows: [] });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Pending)
setTimeout(() => { poll(); }, IModelHost.configuration!.concurrentQuery.pollInterval);
else
resolve({ status: QueryResponseStatus.Error, rows: [pollrc.result] });
}
};
setTimeout(() => { poll(); }, IModelHost.configuration!.concurrentQuery.pollInterval);
return new Promise((resolve) => {
if (!this.isOpen) {
resolve({ status: QueryResponseStatus.Done, rows: [] });
} else {
const postrc = this.nativeDb.postConcurrentQuery(ecsql, JSON.stringify(bindings, replacer), limit!, quota!, priority!);
if (postrc.status !== IModelJsNative.ConcurrentQuery.PostStatus.Done)
resolve({ status: QueryResponseStatus.PostError, rows: [] });
const poll = () => {
if (!this.isOpen) {
resolve({ status: QueryResponseStatus.Done, rows: [] });
} else {
const pollrc = this.nativeDb.pollConcurrentQuery(postrc.taskId);
if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Done)
resolve({ status: QueryResponseStatus.Done, rows: JSON.parse(pollrc.result, reviver) });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Partial)
resolve({ status: QueryResponseStatus.Partial, rows: JSON.parse(pollrc.result, reviver) });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Timeout)
resolve({ status: QueryResponseStatus.Timeout, rows: [] });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Pending)
setTimeout(() => { poll(); }, IModelHost.configuration!.concurrentQuery.pollInterval);
else
resolve({ status: QueryResponseStatus.Error, rows: [pollrc.result] });
const poll = () => {
if (!this.nativeDb || !this.nativeDb.isOpen()) {
resolve({ status: QueryResponseStatus.Done, rows: [] });
} else {
const pollrc = this.nativeDb.pollConcurrentQuery(postrc.taskId);
if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Done)
resolve({ status: QueryResponseStatus.Done, rows: JSON.parse(pollrc.result, reviver) });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Partial)
resolve({ status: QueryResponseStatus.Partial, rows: JSON.parse(pollrc.result, reviver) });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Timeout)
resolve({ status: QueryResponseStatus.Timeout, rows: [] });
else if (pollrc.status === IModelJsNative.ConcurrentQuery.PollStatus.Pending)
setTimeout(() => { poll(); }, IModelHost.configuration!.concurrentQuery.pollInterval);
else
resolve({ status: QueryResponseStatus.Error, rows: [pollrc.result] });
}
};
setTimeout(() => { poll(); }, IModelHost.configuration!.concurrentQuery.pollInterval);