fix: fix max api status calls increment
This commit is contained in:
parent
32e92f8a24
commit
cfbef54217
|
@ -27,14 +27,12 @@ export const upload = async (props: ApiUploadProps, options: Options = {}) => {
|
||||||
|
|
||||||
// recursive status checks
|
// recursive status checks
|
||||||
const checkStatus = async (): Promise<ApiStatusResponse> => {
|
const checkStatus = async (): Promise<ApiStatusResponse> => {
|
||||||
|
if (statusCallsCount > maxApiStatusCalls) throw new Error('max api calls exceeded');
|
||||||
|
|
||||||
const jobStatus = await fetchJobStatus({ token, job });
|
const jobStatus = await fetchJobStatus({ token, job });
|
||||||
const { status, message } = jobStatus;
|
const { status, message } = jobStatus;
|
||||||
|
|
||||||
if (statusCallsCount > maxApiStatusCalls) {
|
|
||||||
statusCallsCount += 1;
|
statusCallsCount += 1;
|
||||||
throw new Error('max api calls exceeded');
|
|
||||||
}
|
|
||||||
|
|
||||||
onStatusProgress(status);
|
onStatusProgress(status);
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
|
|
Loading…
Reference in New Issue