My background task takes a long time to complete, and the OS is just killing it. I'm trying to sync my contacts online, here's what I'm doing:
Get all contacts from phonebook (takes ~1 second)
Upload them to a server (~2 seconds)
Retrieve all contacts from server (~2-3 seconds)
Delete all contacts from ContactStore(ContactStore.DeleteAsync sometimes takes 1 minute to complete)
Create a ContactStore and import all contacts )(~1-2 minutes for 1000 contacts)
I have ~100 contacts and it's working well, but I wanted to test with ~1000 contacts and it doesn't complete every time. I'm using a MaintenanceTrigger, but I think it's still too much for a background task, but I need a confirmation for this. MaintenanceTrigger tasks should be allowed to do more resource intensive tasks, so why is the OS killing my background task?