Hi Pent!
> You could make a test task like this:
>
> Variable Clear, %PINGOK
> HTTP Get
> Variable Set, %PINGOK, 1 [ If %HTTPR = 400 ]
>
> Then when you want to test connectivity:
>
> Perform Task, TestTask
> Flash "OK!" [If Is Set %PINGOK ]
>
> Make sure the priority of TestTask that you set is higher than that of
> the calling task.
Thanks for taking time to answer that quickly!
This will work if the server returns 400. However maybe I didn't use
the good term, instead of "alive" let's talk about "responsive". So, I
want to check if the server answer to the HTTP GET request *before*
that Tasker reach the timeout I set.
I tested multiple things yesterday, but I didn't find the good profile
to create.
The problem is that cannot see how (if I can) detect if the task
reached the timeout or not. If there some internal/undocumented
variables that get set when an error (exception) is returned by
Tasker?
Otherwise, as I said above, I tried to check the "running time" of the
called task (TestTask in your example above) using the %QTIME
variable, but for some reason, it didn't work at all
So, I check with a simpler version of yours, just to make sure that
the next actions of the tasks that call TestTask was working. So I did
this:
-------
(CallingTask) [Priority = 5]
Perform Task, TestTask [Stop Is Set] [Priority = 7]
Flash "OK!"
(TestTask)
HTTP Get [Timeout = 5]
-------
My problem here is that "Flash "OK!" is never triggered. I was
expecting it to get triggered after the timeout of TestTask... however
I just get the IO error from the HTTP Get action, and nothing else :|
This may tell you what I do wrong!
Finally, may I suggest a message update? When you create a task, and
then create another task that call that newly created task, then the
user gets the message "task not existing" or something similar. I
would suggest to change it for something thing: "task not existing:
make sure you applyed new tasks". Just to make sure that the user know
that he has to apply all changes to tasker in order to have access to
it :)
Thanks for your help!
Take care,
Fred