什么是区域转弯? [英] What are zone turns?

查看:41
本文介绍了什么是区域转弯?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在angular2应用程序中遇到了以下错误.

I encountered the following error in an angular2 application.

 WARNING: your application is taking longer than 2000 Zone turns.

我的问题:什么是区域转弯",为什么它在2000以上时会警告我?(我知道我可以更改限制,但是那为什么我要这样做?)

My question: What are 'zone turns', why does it warn me when it is above 2000? (I know I can change the limit, but then, why would I do this?)

推荐答案

此错误是Angular2/Universal产生的.处理区域微任务队列时,在处理了队列中的2000个任务后,仍然有待处理的任务.这可能是由于大量异步工作本身使许多异步任务排队.Angular希望队列最终会变空.

This error is produce by Angular2/Universal. When the zones microtask queue is processed and after processing 2000 tasks from the queue there are still pending tasks. This might be caused by lots of async work that itself enqueues lots of async tasks. Angular expects the queue to eventually become empty.

https://github.com/angular/universal/issues/377#issuecomment-215229702

如果愿意,可以将maxZoneTurns设置为10000

you can set maxZoneTurns to 10000 if you like or higher

产生错误的来源 https://github.com/angular/universal/blob/9508ac03650ca0439192b8ed49ce8f1e57b6be33/modules/universal/src/node/bootloader.ts#L158

这篇关于什么是区域转弯?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆