flutter_foreground_task icon indicating copy to clipboard operation
flutter_foreground_task copied to clipboard

Not Restarting after a long time of pause/kill by OS

Open vinayvinu9876 opened this issue 2 years ago • 0 comments

  1. We are recording the time when the foreground task was last run , based on the last run time and pending tasks. We determine if the foreground was stopped abruptly by the OS.
  2. We are restarting when the heartbeat is older than 2 minutes while assigning a new task.
  3. we observed that it is not starting on many devices. Please check the restart mechanism on long run and 10 to 15 network requests.

`Normal Execution

[38;5;12m💡 Start Foreground Task : Starting new Foreground Task[0m [38;5;12m💡 Start Foreground Task : Setting Base URL = https://apis.wow-firebase-apps.wheelocity.com[0m [38;5;12m💡 Start Foreground Task : Is Test = prod[0m [38;5;12m💡 Start Foreground Task : User ID = PBTN01030[0m [38;5;12m💡 Start Foreground Task : starting new service[0m [38;5;12m💡 Start Foreground Task : Started new foreground service. Result = true[0m [38;5;12m💡 Start Foreground Task : Started = true[0m [38;5;12m💡 -------------------------onStart at 2023-11-21 05:31:53.404064-----------------------[0m [38;5;12m💡 Event created at 2023-11-21 05:31:53.406496 port = SendPort[0m [38;5;12m💡 event started at 2023-11-21 05:31:53.406496. Time = 2023-11-21 05:31:53.406496[0m [38;5;12m💡 Api Endpoint from foreground task = https://apis.wow-firebase-apps.wheelocity.com[0m [38;5;12m💡 androidID = 60dc3f8a48d50685[0m [38;5;12m💡 -------------------------Run Sync Service at 2023-11-21 05:31:53.415505-----------------------[0m `

` Restarting multiple times but not restarting. And the restart flag is true.

[38;5;12m💡 Start Foreground Task : Starting new Foreground Task[0m [38;5;12m💡 Start Foreground Task : Setting Base URL = https://apis.wow-firebase-apps.wheelocity.com[0m [38;5;12m💡 Start Foreground Task : Is Test = prod[0m [38;5;12m💡 Start Foreground Task : User ID = PBTN01030[0m [38;5;12m💡 Start Foreground Task : Foreground Task was already Running[0m [38;5;12m💡 Start Foreground Task : Hard Restarting the foreground service. Hard Restart Flag = true. Is Abnormal Heartbeat = true. Last Heartbeat = 2023-11-20 20:50:10.489[0m [38;5;12m💡 Start Foreground Task : Restarted foreground service. Result = true[0m [38;5;12m💡 Start Foreground Task : Started = true[0m [38;5;12m💡 Start Foreground Task : Starting new Foreground Task[0m [38;5;12m💡 Start Foreground Task : Setting Base URL = https://apis.wow-firebase-apps.wheelocity.com[0m [38;5;12m💡 Start Foreground Task : Is Test = prod[0m [38;5;12m💡 Start Foreground Task : User ID = PBTN01030[0m [38;5;12m💡 Start Foreground Task : Foreground Task was already Running[0m [38;5;12m💡 Start Foreground Task : Hard Restarting the foreground service. Hard Restart Flag = true. Is Abnormal Heartbeat = true. Last Heartbeat = 2023-11-20 20:50:10.489[0m [38;5;12m💡 Start Foreground Task : Restarted foreground service. Result = true[0m [38;5;12m💡 Start Foreground Task : Started = true[0m [38;5;12m💡 Start Foreground Task : Starting new Foreground Task[0m [38;5;12m💡 Start Foreground Task : Setting Base URL = https://apis.wow-firebase-apps.wheelocity.com[0m [38;5;12m💡 Start Foreground Task : Is Test = prod[0m [38;5;12m💡 Start Foreground Task : User ID = PBTN01030[0m [38;5;12m💡 Start Foreground Task : Foreground Task was already Running[0m [38;5;12m💡 Start Foreground Task : Hard Restarting the foreground service. Hard Restart Flag = true. Is Abnormal Heartbeat = true. Last Heartbeat = 2023-11-20 20:50:10.489[0m [38;5;12m💡 Start Foreground Task : Restarted foreground service. Result = true[0m [38;5;12m💡 Start Foreground Task : Started = true[0m`

vinayvinu9876 avatar Nov 21 '23 12:11 vinayvinu9876