diff --git a/library/src/main/ets/ImageKnifeDispatcher.ets b/library/src/main/ets/ImageKnifeDispatcher.ets index 139b353..593e7e4 100644 --- a/library/src/main/ets/ImageKnifeDispatcher.ets +++ b/library/src/main/ets/ImageKnifeDispatcher.ets @@ -359,7 +359,7 @@ export class ImageKnifeDispatcher { let pixelmap = requestJobResult.pixelMap; if (pixelmap === undefined) { - LogUtil.error('ImageKnife_DataTime_getAndShowImage_CallBack.pixelmap undefined:'+currentRequest.imageKnifeOption.loadSrc + " error: " + requestJobResult.loadFail) + LogUtil.error('ImageKnife_DataTime_getAndShowImage_CallBack.pixelmap failed:'+currentRequest.imageKnifeOption.loadSrc + " error: " + requestJobResult.loadFail) requestList.forEach((requestWithSource: ImageKnifeRequestWithSource) => { requestWithSource.request.requestState = ImageKnifeRequestState.ERROR this.executingJobMap.remove(memoryKey); @@ -492,6 +492,12 @@ export class ImageKnifeDispatcher { dispatchNextJob() { LogUtil.log('ImageKnife_DataTime_dispatchNextJob.start') + + // 主图和错误图并发加载时,以及主图加载失败后立即加载错误图,可能会导致短时间内并发数超过maxRequests,故此处减少响应的并发 + if (this.executingJobMap.length >= this.maxRequests) { + return + } + while (true) { let request = this.jobQueue.pop() if (request === undefined) {