background-task

can't start beginBackgroundTask swift 3

烂漫一生 提交于 2019-12-05 10:49:38
Sorry I am stuck, but I am trying to start background task (XCode8, swift 3) Example from here: https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH4-SW3 In AppDelegate.swift: func applicationDidEnterBackground(_ application: UIApplication) { var bgTask: UIBackgroundTaskIdentifier = 0; bgTask = application.beginBackgroundTask(withName:"MyBackgroundTask", expirationHandler: {() -> Void in print("The task has started") application.endBackgroundTask(bgTask) bgTask =

Windows Phone 8.1 background task closes before completion

天涯浪子 提交于 2019-12-05 08:59:29
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

How to debug a UWP UpdateTask?

我的梦境 提交于 2019-12-05 02:32:44
问题 In my UWP app, how can I debug through the code in my UpdateTask? The ‘Lifecycle Events’ dropdown in VS 2017 doesn’t seem to offer a choice to trigger this type of background task. Is there a way to accomplish this? 回答1: First some context on UWP's UpdateTask: It’s a background task your app can implement to get triggered by the system when your UWP has received an update. It runs your code from the updated app package in a background process, so you can take care of any maintenance related

how to use django-background-tasks

故事扮演 提交于 2019-12-05 01:19:47
问题 I am making a django application. To calculate the rank of the feeds based on lines and comment, I am trying to use django-background-tasks. the function I am using in nodes models is: @background(schedule=60) def get_score(self): p = self.likes+self.comments # popularity t = (now()-self.date).total_seconds()/3600 # age_in_hrs # last_activity = n = self.admin_score score = (p/pow((t+1), 1.2))*n self.score = score return score But I am not seeing any change in score. That means that I am doing

iOS background task using NSURLSessionDataTask

柔情痞子 提交于 2019-12-04 20:17:58
I have flight search feature in my application which is taking too long to get the data (more than 25 seconds). if application goes background or went to sleep mode, internet connection get disconnected. I have written below logic using apple example to make api request keep going even though if app goes to background but it's not working. self.session = [self backgroundSession]; self.mutableData = [NSMutableData data]; NSURL *downloadURL = [NSURL URLWithString:@"http://jsonplaceholder.typicode.com/photos"]; NSURLRequest *request = [NSURLRequest requestWithURL:downloadURL]; self.dataTask =

Continue download in background

↘锁芯ラ 提交于 2019-12-04 10:44:07
问题 I am creating an application wherein I am downloading some data from server. While going in background I want that connection should continue running so that data can be downloaded. I know there is method in appDelegate - (void)applicationDidEnterBackground:(UIApplication *)application which is called when application enters background. But as the connection is created in viewController, how can it be managed in appDelegate ? Also is/are there other way(s) this can be done? I have gone

How to debug a UWP UpdateTask?

女生的网名这么多〃 提交于 2019-12-03 17:13:21
In my UWP app, how can I debug through the code in my UpdateTask? The ‘Lifecycle Events’ dropdown in VS 2017 doesn’t seem to offer a choice to trigger this type of background task. Is there a way to accomplish this? First some context on UWP's UpdateTask: It’s a background task your app can implement to get triggered by the system when your UWP has received an update. It runs your code from the updated app package in a background process, so you can take care of any maintenance related to the specific update (e.g. change in data structures). To set up an UpdateTask for your app you need to do

how to use django-background-tasks

不打扰是莪最后的温柔 提交于 2019-12-03 16:35:58
I am making a django application. To calculate the rank of the feeds based on lines and comment, I am trying to use django-background-tasks. the function I am using in nodes models is: @background(schedule=60) def get_score(self): p = self.likes+self.comments # popularity t = (now()-self.date).total_seconds()/3600 # age_in_hrs # last_activity = n = self.admin_score score = (p/pow((t+1), 1.2))*n self.score = score return score But I am not seeing any change in score. That means that I am doing it in a right way and i am missing the basic concept. Can somebody tell me how to use django

BackGround Task to trigger if any changes in the Action Center

我是研究僧i 提交于 2019-12-02 11:54:48
问题 I need to trigger my background task when the application added the toast notification to the action center. I have tried with ToastNotificationHistoryChangedTrigger and it's not triggering the task when the application added the toast notification. Is there any solution for it? 回答1: ToastNotificationHistoryChangedTrigger is fired whenever the collection of toast notification history from your app changes on the device. Subscribing this trigger, will allow your app to get notified when: A

Redirect to action after finishing background task queue

倖福魔咒の 提交于 2019-12-02 11:20:27
I'm working on a .Net core solution that takes backup of storage files from another microservice and because this process takes too long time, we decided to build this routine under a background task.By following this link: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-2.1 I have implemented the background by using Queued background tasks like the following : public interface IBackgroundTaskQueue { void QueueBackgroundWorkItem(Func<CancellationToken, Task> workItem); Task<Func<CancellationToken, Task>> DequeueAsync( CancellationToken