0
votes

I have recently ported my LOB Win 8 RT App across to UWP. I am using Background Tasks to connect to web services and download/upload data.

On a low spec Win 10 tablet I have both the Win8 app and UWP app. The Win8 app behaves fine however the UWP app the cancellation event handler gets called with error ExcecutionTimeExceeded. This occurs after aprox 23 seconds. It does not download all the data (whereas the Win 8 app on same device does).

However when I ran the app on my laptop (higher spec) the background task runs successfully after aprox 40-50 seconds.

Is the "ExectionTimeExceeded" related to the CPU of the device? Has this changed between Win 8 Store Apps and UWP?

Also - I am using a BackgroundTaskDeferral.

1

1 Answers

1
votes

Is the "ExectionTimeExceeded" related to the CPU of the device?

According to Background​Task​Cancellation​Reason enum, for ExecutionTimeExceeded it says:

The background task was cancelled because it exceeded its allotted time to run.

In UWP, the background task do has CPU constraint that CPU need guarantee 10% . More constraints you may reference the slide 22 of this PPT. But for the ExecutionTimeExceeded cancel reason it should be caused by constraint of "wall clock quota". Background tasks are limited to 30 seconds of wall-clock usage except for longing trigger (25s for running and 5s for canceling). So your background task should execute less than 25s, if exceeded, task will be canceled and return the ExecutionTimeExceeded cancel reason.

Has this changed between Win 8 Store Apps and UWP?

It may be yes. It seems like in windows 8.1, all background tasks have CPU and network usage quotas but there're no wall clock quota limits. More details please reference slide 21 of this PPT.

However when I ran the app on my laptop (higher spec) the background task runs successfully after aprox 40-50 seconds.

For this I'm not sure why this happened on your side. Maybe your laptop is windows 8.1, or you calculate the wrong execute time, or some other reasons. But the background task just limited to 30 seconds as I mentioned above no matter how higher spec of your device.

More details please reference Support your app with background tasks.