Alpha-08:应用程式可能无法安排超过100个不同的工作 [英] Alpha-08: Apps may not schedule more than 100 distinct jobs
问题描述
我环顾四周,共识是它已固定在Alpha-07上,但我看到它在08年的7.0 AND 8.0设备上.我受到网络的限制,因此很可能在长时间没有网络的情况下,我可以安排100个以上的工作项目.我对批处理在其中的作用有些困惑.我们是说WorkManager在崩溃之前只能安排100个项目,还是还有一个批处理错误?谢谢
I've looked around and the consensus is it's fixed on Alpha-07, but I'm seeing it in 08 on a 7.0 AND 8.0 device. I have network constraints so there is a possibility that given a long period of no network I could schedule more than 100 work items. I'm a little confused about how batching plays into this. Are we saying WorkManager can only schedule 100 items before it crashes or is there still a batching bug? Thanks
添加到WM的代码:
Constraints constraints = new Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED)
.build();
Data inputData = new Data.Builder()
.putString(UploadWorker.DATA, data)
.build();
OneTimeWorkRequest uploadWork = new OneTimeWorkRequest.Builder(UploadWorker.class)
.setConstraints(constraints)
.setInputData(inputData)
.setBackoffCriteria(BackoffPolicy.EXPONENTIAL, BACK_OFF_TIME_DELAY_SECONDS, TimeUnit.SECONDS)
.addTag(TAG)
.build();
WorkManager workManager = WorkManager.getInstance();
workManager.enqueue(uploadWork);
推荐答案
WorkManager库的一个新版本(版本alpha09)应彻底解决此问题.如发行说明所述:
There's a new version of the WorkManager library (version alpha09) that should solves this issue once for all. As reported in the release notes:
添加了"100个作业"错误所需的另一个修复程序. b/115560696
要了解WorkManager库的发展情况,一个不错的选择是留意它的问题跟踪器.
A good option to see how the WorkManager library is evolving is to keep an eye on its issue tracker.
这篇关于Alpha-08:应用程式可能无法安排超过100个不同的工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!