20180120 02.56.00 P Instant ID4 Every 2m
20180120 02.56.00 E Start ID0:0.0 TaskService
20180120 02.56.00 T Running ID3 Run
20180120 02.56.00 A OK ID3.1 Run.If
20180120 02.56.00 A OK ID3.2 Run.HTTP Get
20180120 02.56.00 A OK ID3.3 Run.Var Set, %LastScript=1516445820
20180120 02.56.00 T Running ID5:2 Rerun
20180120 02.56.00 A OK ID3.4 Run.Perform Task, Rerun
20180120 02.56.00 A OK ID5:2.1 Rerun.Stop
20180120 02.56.00 T ExitOK ID3 Run
20180120 02.56.01 A OK ID5:2.2 Rerun.Wait
20180120 02.56.01 T Running ID3:3 Run
20180120 02.56.01 A OK ID5:2.3 Rerun.Perform Task, Run
20180120 02.56.01 T ExitOK ID5:2 Rerun
20180120 02.56.01 A OK ID3:3.1 Run.If
20180120 02.56.01 A OK ID3:3.6 Run.JavaScript
20180120 02.56.01 T Running ID-354:4 JSI:3:-936496730
20180120 02.56.01 A OK ID-354:4.1 JSI:3:-936496730.Run Shell
20180120 02.56.01 T ExitOK ID-354:4 JSI:3:-936496730
20180120 02.56.01 T Running ID-355:5 JSI:3:1425153782
20180120 02.56.01 A OK ID-355:5.1 JSI:3:1425153782.Run Shell
20180120 02.56.02 T ExitOK ID-355:5 JSI:3:1425153782
20180120 02.56.02 T Running ID-356:6 JSI:3:1649921135
20180120 02.56.02 A OK ID-356:6.1 JSI:3:1649921135.Run Shell
20180120 02.56.03 T ExitOK ID-356:6 JSI:3:1649921135
20180120 02.56.03 T Running ID-357:7 JSI:3:385713919
20180120 02.56.03 A OK ID-357:7.1 JSI:3:385713919.Run Shell
20180120 02.56.03 T ExitOK ID-357:7 JSI:3:385713919
20180120 02.56.03 T Running ID-358:8 JSI:3:-1476669316
20180120 02.56.03 A OK ID-358:8.1 JSI:3:-1476669316.Run Shell
20180120 02.56.03 T ExitOK ID-358:8 JSI:3:-1476669316
20180120 02.56.03 T Running ID-359:9 JSI:3:1898177403
20180120 02.56.03 A OK ID-359:9.1 JSI:3:1898177403.Run Shell
20180120 02.56.05 T Running ID-360:10 JSI:3:743893578
20180120 02.56.05 A OK ID-360:10.1 JSI:3:743893578.Wait
20180120 02.56.05 T ExitOK ID-360:10 JSI:3:743893578
20180120 02.56.05 T Running ID-361:11 JSI:3:-350372945
20180120 02.56.05 A Err ID-361:11.1 JSI:3:-350372945.Load Image
20180120 02.56.05 T ExitErr ID-361:11 JSI:3:-350372945
20180120 02.56.05 T Running ID-362:12 JSI:3:-1271801810
20180120 02.56.06 A OK ID-362:12.1 JSI:3:-1271801810.Wait
20180120 02.56.06 T ExitOK ID-362:12 JSI:3:-1271801810
20180120 02.56.06 T Running ID-363:13 JSI:3:635163085
20180120 02.56.06 A Err ID-363:13.1 JSI:3:635163085.Save Image
20180120 02.56.06 T ExitErr ID-363:13 JSI:3:635163085
20180120 02.56.06 T Running ID-364:14 JSI:3:1885022614
20180120 02.56.06 A OK ID-364:14.1 JSI:3:1885022614.Wait
20180120 02.56.06 T ExitOK ID-364:14 JSI:3:1885022614
20180120 02.56.06 T Running ID-365:15 JSI:3:-248350903
20180120 02.56.06 A OK ID-365:15.1 JSI:3:-248350903.Run Shell
20180120 02.56.06 T ExitOK ID-365:15 JSI:3:-248350903
20180120 02.56.07 T Running ID-366:16 JSI:3:-493326862
20180120 02.56.07 A OK ID-366:16.1 JSI:3:-493326862.Wait
20180120 02.56.07 T ExitOK ID-366:16 JSI:3:-493326862
20180120 02.56.07 T Running ID-367:17 JSI:3:-1000642666
20180120 02.56.07 A OK ID-367:17.1 JSI:3:-1000642666.Run Shell
20180120 02.56.07 T ExitOK ID-367:17 JSI:3:-1000642666
20180120 02.56.07 T Running ID-368:18 JSI:3:790912091
20180120 02.56.07 A OK ID-368:18.1 JSI:3:790912091.Run Shell
20180120 02.56.07 T ExitOK ID-368:18 JSI:3:790912091
20180120 02.56.07 T Running ID-369:19 JSI:3:-732474446
20180120 02.56.07 A OK ID-369:19.1 JSI:3:-732474446.Run Shell
20180120 02.56.08 T ExitOK ID-359:9 JSI:3:1898177403
20180120 02.56.09 T ExitOK ID-369:19 JSI:3:-73247444620180120 03.04.00 P Instant ID4 Every 2m
20180120 03.04.00 T Running ID-3004:375 JSI:2302:-984201292
20180120 03.04.00 T Running ID-3005:376 JSI:2302:-119799323
20180120 03.04.00 A OK ID-3005:376.1 JSI:2302:-119799323.Run Shell
20180120 03.04.00 T Running ID-3006:377 JSI:2302:263550860
20180120 03.04.00 T Running ID-3007:378 JSI:2302:-507455570
20180120 03.04.00 A OK ID-3007:378.1 JSI:2302:-507455570.Run Shell
20180120 03.04.00 A OK ID-3006:377.1 JSI:2302:263550860.Run Shell
20180120 03.04.00 T ExitOK ID-3005:376 JSI:2302:-119799323
20180120 03.04.00 A OK ID-3004:375.1 JSI:2302:-984201292.Run Shell
20180120 03.04.00 T ExitOK ID-3007:378 JSI:2302:-507455570
20180120 03.04.00 T ExitOK ID-3004:375 JSI:2302:-984201292
20180120 03.04.01 T ExitOK ID-3006:377 JSI:2302:263550860
20180120 03.06.00 P Instant ID4 Every 2m
20180120 03.06.00 T Running ID-3009:379 JSI:2302:-2134589073
20180120 03.06.00 T Running ID-3010:380 JSI:2302:-1827936338
20180120 03.06.00 A OK ID-3010:380.1 JSI:2302:-1827936338.Run Shell
20180120 03.06.00 T Running ID-3011:381 JSI:2302:2074347881
20180120 03.06.00 A OK ID-3011:381.1 JSI:2302:2074347881.Run Shell
20180120 03.06.00 T Running ID-3012:382 JSI:2302:-169384417
20180120 03.06.00 A OK ID-3012:382.1 JSI:2302:-169384417.Run Shell
20180120 03.06.00 A OK ID-3009:379.1 JSI:2302:-2134589073.Run Shell
20180120 03.06.00 T ExitOK ID-3010:380 JSI:2302:-1827936338
20180120 03.06.00 T ExitOK ID-3009:379 JSI:2302:-2134589073
20180120 03.06.00 T ExitOK ID-3011:381 JSI:2302:2074347881
20180120 03.06.00 T ExitOK ID-3012:382 JSI:2302:-169384417Here is an example of it working normally:
Run (3) A1: If [ %TIMES > %LastScript ] A2: HTTP Get [ Server:Port:http://%Host/getjs/ Path: Attributes: Cookies: User Agent: Timeout:10 Mime Type: Output File:run.js Trust Any Certificate:Off Continue Task After Error:On ] A3: Variable Set [ Name:%LastScript To:%TIMES + 60 Recurse Variables:Off Do Maths:On Append:Off ] A4: Perform Task [ Name:Rerun Priority:%priority + 1 Parameter 1 (%par1):Run Parameter 2 (%par2): Return Value Variable: Stop:Off ] A5: End If A6: JavaScript [ Path:run.js Libraries: Auto Exit:Off Timeout (Seconds):50 Continue Task After Error:On ] A7: Wait [ MS:%waittime Seconds:0 Minutes:0 Hours:0 Days:0 ]
I realize it looks weird but I am just trying things to get it to not stack up the task queue. Even though "Run" is set to abort new executions,
Run is set to Abort New Task because I don't want to interrupt it if it is already running and it is supposed to be running most of the time. The profile is simply meant to ensure that if the loop ever stops, it will start up again within 2 minutes.
The javascript action is running a javascript file that it downloads. That script is doing a bunch of shell commands and different logic. It's actually fairly complex.I don't know if it is because of the complexity, but it does seem to have to do with the javascript action.
20180122 00.00.32 T ExitOK ID5:1426 Killtask
20180122 00.00.32 E Stop ID0:0.0 TaskService
20180122 00.02.00 P Instant ID4 Every 2m
20180122 00.02.00 E Start ID0:0.0 TaskService
20180122 00.02.00 T Running ID6 Anon
20180122 00.02.00 T Running ID3:2 Run
20180122 00.02.00 A OK ID6.1 Anon.Perform Task, Run
20180122 00.02.00 T ExitOK ID6 Anon
20180122 00.02.00 A OK ID3:2.1 Run.If
20180122 00.02.00 A OK ID3:2.2 Run.HTTP Get
20180122 00.02.00 A OK ID3:2.3 Run.Var Set, %LastScript=1516608180
20180122 00.02.00 T Running ID2:3 Rerun
20180122 00.02.00 A OK ID3:2.4 Run.Perform Task, Rerun
20180122 00.02.00 A OK ID2:3.1 Rerun.Stop
20180122 00.02.00 T ExitOK ID3:2 Run
20180122 00.02.00 A OK ID2:3.2 Rerun.Wait Until
20180122 00.02.00 T Running ID3:4 Run
20180122 00.02.00 A OK ID2:3.3 Rerun.Perform Task, Run
20180122 00.02.00 T ExitOK ID2:3 Rerun
20180122 00.02.00 A OK ID3:4.1 Run.If
20180122 00.02.00 A OK ID3:4.6 Run.JavaScript
20180122 00.02.00 T Running ID-9349:5 JSI:4:2114289858
20180122 00.02.00 A OK ID-9349:5.1 JSI:4:2114289858.Run Shell
20180122 00.02.00 T ExitOK ID-9349:5 JSI:4:2114289858
20180122 00.02.00 T Running ID-9350:6 JSI:4:-1155935881
20180122 00.02.00 A OK ID-9350:6.1 JSI:4:-1155935881.Run Shell
20180122 00.02.02 T ExitOK ID-9350:6 JSI:4:-1155935881
20180122 00.02.02 T Running ID-9351:7 JSI:4:-756807822
20180122 00.02.02 A OK ID-9351:7.1 JSI:4:-756807822.Run Shell
20180122 00.02.02 T ExitOK ID-9351:7 JSI:4:-756807822
20180122 00.02.02 T Running ID-9352:8 JSI:4:-135088493
20180122 00.02.02 A OK ID-9352:8.1 JSI:4:-135088493.Run Shell
20180122 00.02.03 T ExitOK ID-9352:8 JSI:4:-135088493
.You will occasionally course need to disable and re-enable Tasker to stop the currently running javascript action. I would even do a reboot while Tasker is disabled to be sure to stop everything.
Can you just have the javascript loop once within the javascript action then do the loop with a Tasker goto action? I think that might solve the issue.
That's how it works. The javascript runs through and exits. I have an exit() statement and also auto-exit turned on. I use a goto to loop the task and the Javascript action is called again. I don't think it's an issue of the Javascript action not stopping because the task loops fine.
I am not super clear what the numbers actually mean. The runlog page doesn't explain the difference between something like "ID-2:3" and "ID2:3"
That's how it works. The javascript runs through and exits. I have an exit() statement and also auto-exit turned on.
By default, the JavaScript(let) action will end when the main execution sequence is finished.
If you are using asynchronous code e.g. via setTimeout() or other callbacks, you should deselect Auto Exit. You are then responsible yourself for telling Tasker to continue the task by calling exit().
In any case, execution will stop when the timeout configured for the action is reached.
In the example above for 'not working correctly' it looks like the shell actions are not going in order. Is there any logic in your JavaScript to ensure one shell actions finishes before the next runs?
I mentioned a few comments back that I have a profile that kills all tasks every 30 minutes.
However, for the sake of desperation, I will try the way you just mentioned
after I am done testing a minimal JS version that hopefully someone else could reproduce.
That would be very helpful.
<TaskerData sr="" dvi="1" tv="5.1m">
<Profile sr="prof3" ve="2">
<cdate>1516660002648</cdate>
<edate>1516750383472</edate>
<id>3</id>
<mid0>2</mid0>
<Time sr="con0">
<fh>-1</fh>
<fm>-1</fm>
<rep>2</rep>
<repval>2</repval>
<th>-1</th>
<tm>-1</tm>
</Time>
</Profile>
<Project sr="proj0" ve="2">
<cdate>1516750359333</cdate>
<name>Testproject</name>
<pids>3</pids>
<tids>2</tids>
</Project>
<Task sr="task2">
<cdate>1516659500421</cdate>
<edate>1516750323352</edate>
<id>2</id>
<nme>Test</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>129</code>
<se>false</se>
<Str sr="arg0" ve="3">var test = function(){
return shell('settings get secure android_id', true, 10);
}
for (var i = 0; i<10;i++) {
test(); // simulate 10 more shell calls
}
flash(test()); // signal that its working
exit();</Str>
<Str sr="arg1" ve="3"/>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="45"/>
</Action>
<Action sr="act1" ve="7">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="4"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act2" ve="7">
<code>135</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="1"/>
<Str sr="arg2" ve="3"/>
</Action>
</Task>
</TaskerData>Using the setup where the Task "Test" is called when %TRUN !~ *,Test,* still causes the JSI ID to rise and never reset.I was able to reproduce the problem with this simple project. Unfortunately it takes hours for it to actually stop working but you can at least see the IDs rising forever. In fact, I am finding that they continue to rise even after tasker is disabled and re-enabled. It requires a restart of the phone to get the number to reset.
How long did you run it for?
Because using the %TRUN profile method, my JSI execution numbers do still increment. However they do seem to at least reset when the taskservice restarts.
Strange, the task service does not stop for me.
I agree. My little profile to kill all tasks every 30 minutes seems to help a lot. After about 24 hours, 1 of 4 phones (they are all identical models and software) stopped working with an execution ID up around 700 something. My hope is that lowering that number to 15 minutes will eliminate any chance of this happening.
So I guess now the question is, why my phones don't stop the task service when using the %TRUN!~ method, and is there something that Pent could do prevent the execution id buildup.