conflicting priorities with multiple projects

52 views
Skip to first unread message

Chuck Kollars

unread,
Mar 21, 2023, 12:38:02 AM3/21/23
to Tasker
I have several Tasker functions that run a long time (essentially as "background" tasks). Each function includes tasks that run at several different priorities. Each function works fine in isolation; so far so good. 

But when I run all the functions at the same time, the higher priorities of one often cause another to misbehave. 

What is the standard way to handle (or forestall) this sort of problem? 

Rich D

unread,
Mar 21, 2023, 5:44:36 AM3/21/23
to Tasker Google Groups Post

What is the standard way to handle (or forestall) this sort of problem? 

It really depends on exactly is causing the issues and how exactly these tasks are getting started. Could you give at least one example of the issue with the full exported descriptions of tasks and profiles involved with a description of the Issue?   The best place to start finding the problems is with the run  log. There is a section in the user guide explain the Run Log. 




To post your profile or task here...  Long press on the profile or task name -> ( 3 dot menu with 4.0+ ) Export -> Export "DESCRIPTION" to clipboard (not XML) -> 'Four Space' option (for proper formating in reddit)

Any linked tasks will be exported with the profile they are linked to..

To be able to export, the profile needs to be named by you (Not the Tasker listed name.  Tasker will list your profile with the context name if you have not given it one). 

    !!!  Be sure to review the Description and remove any personal information !!!

On older Tasker versions you might need to disable beginner mode in the Tasker preferences. Beginner mode has been removed from the latest Tasker release. 


I assume if these are long running Tasks then the Wait Action is a most likely culprit.  Give This a read and see if it brings some clarity to your issues.. 


Section 8 gives a example of how to launch tasks that will only run in a synchronized order IE.. 'First in First Out'. 


Rich D

unread,
Mar 21, 2023, 6:04:04 AM3/21/23
to Tasker Google Groups Post

But when I run all the functions at the same time, the higher priorities of one often cause another to misbehave. 

In addition to my last reply, The best way to avoid colliding tasks is to prevent them from starting at the contextual level IE managing your profiles. The best option for that is to add additional contexts that test the state of the other Profiles or Tasks.

  There is a Context -> State -> Profile Active  and a Context -> State -> Task Running That will allow  you prevent your profile from triggering if another profile is currently active or a Task is currently running.

 To Test these from within a Running Task you can use the system variables %PACTIVE and  %TRUN. These are explained in the user guide. A typical test would look like 

IF %PACTIVE <matches> *,Name Of Profile,*   


The *,,* are important as you are testing a comma separated list. This is explained in the user guide under Pattern Matching. 

Chuck Kollars

unread,
Mar 21, 2023, 1:37:51 PM3/21/23
to Tasker
Sorry for not making my problem clearer. I very much appreciate the considerable effort to answer my question  ...I just wish now I'd avoided misdirecting the response. I'm NOT looking for a solution to _this_particular_problem_, and I'm NOT looking for help with implementation mechanics. What I am looking for is _general_ pointers toward a style of coding that will make such problems much much easier to deal with in the future. 

(Also, as all my functions really need to fully run during the same extended time period, I don't understand how deferring some parts of a second function whenever they might conflict would help me.)

ktmom

unread,
Mar 22, 2023, 12:22:15 PM3/22/23
to Tasker
I'm going to make an assumption here that your tasks that run for an extended time are using wait actions.  The waits can interfere with Tasker's scheduling and maybe create the problems you are experiencing.  If you use a time profile that depends on a variable, then set that variable within the task that needs to resume after a pause, you can avoid "long" waits.  There is a discussion of this approach somewhere on the Reddit Tasker sub.

ktmom

unread,
Mar 22, 2023, 12:53:42 PM3/22/23
to Tasker

animatrix

unread,
Mar 22, 2023, 1:35:52 PM3/22/23
to Tasker
Sorry to post it here but how can i start a new topic here? I don't see any button related to creating a new message both on desktop or mobile.

ktmom

unread,
Mar 22, 2023, 3:42:36 PM3/22/23
to Tasker
Doesn't work (for me) on mobile, but if desktop mode is enabled:

While in the "conversations" view (list of all posts), extreme top left there is a "hamburger" menu button.  There's a prominent "New Conversation" button.

Chuck Kollars

unread,
Mar 23, 2023, 1:34:38 AM3/23/23
to Tasker
How would you set a timer for "the max length of a movie"? I silence all volumes when the movie starts. Then after say "three hours" I want to complain if the volumes haven't been turned back on. How can I do this without a "wait"? Some sort of profile that triggers when time's up seems to me like I couldn't make it work, because the times in a profile are always absolute, never relative (i.e. "three hours from now"). I thought the easiest way to do this was with a wait. That seemed to work, but as you suspected it started to cause problems with priorities when more and more functions were activated. So what's a better way to do it?

thanks!

Rich D

unread,
Mar 23, 2023, 7:33:34 AM3/23/23
to Tasker Google Groups Post
because the times in a profile are always absolute, never relative (i.e. "three hours from now"). 

The Time context allows for the use of global variables. So you can dynamically set the times. It also accepts epoch seconds. 
 This is usually the easiest way to set up a time contex.  You can set the From and Till time to the same global variable to use it as a event context.  
So for 3 hours in the future you would simply set 

%Timer = %TIMES + (3*60*60)

Unfortunately the time context does not use the date portion of the epoch seconds. This limits you to a 24-hour time span.  It will only use the time portion. So using the above method will set a time context to fire on that exact time for every day. Here is a method that will allow you to test the date part of the time context so it would only trigger once. This also allows you to set the timer for any amount of time in the future. 


Profile: Example Time: From %Timer Till %Timer 

Enter Task: Anon

 A1: Parse/Format DateTime
   Input Type: Seconds Since Epoch
   Input: %Timer Output 
   Format: M-d-yy 
   Formatted Variable Names: %check
   
A2: If [ %DATE ~ %check ]
A3:     Notify [ Title: Example ]
A4: End If



ktmom

unread,
Mar 23, 2023, 9:02:27 AM3/23/23
to Tasker
If I'm using xyz app and I want notifications silenced while using that app, I  use a context for that app where the enter task silences and either the profile settings have "restore settings" enabled, or I proactively reverse the silencing in an exit task. 

This means, any time I  e.g. Netflix, the notifications get silenced and when I close it,  is restored.

Brenden M

unread,
Mar 23, 2023, 1:54:05 PM3/23/23
to Tasker
You can literally stare at your watch for 3 hours, or you can just set an alarm. Same principle for the cell processor/ sequencer.

To be specific, you can set a "wait" for 3:00:00 or on the other hand you could say "it's high noon, so at 3 pm I need an alarm" (this is the time context mentioned above). No task will have a wait, but set up and wait for variables on calculated schedules.

Small waits usually you'd "get away with it" but long waits, would be better to calculate a time for a context to write a variable or continue tasks at a specified time.

"Time" might proceed in both situations, but "waiting every second" versus "being reminded at the right time" is very different experience.
Reply all
Reply to author
Forward
0 new messages