← Back to team overview

gtg-user team mailing list archive

Re: Unpredictable behaviour from simple script

 

> Sometimes I get 2 tasks, sometimes 3, sometimes I get an exception.
> What's the deal? Am I using the API incorrectly, or is there some
> buggy threading interaction going on?

I have the answer.

If you add a time.sleep(1) after the get_requester line, everything will
be fine.

The reason for that is the following : the requester is started in its own
thread beacause it can take time to build it.

You can see that in the GTK interface with a very long task list : tasks
will be added progressively to the interface during the first second.

So what is happening right now is that the requester has still not read
the whole XML file.

The problem I see is that the "every task is loaded" has no sense with
some backend. A connected backend, for example, could only say : those
were the task at time XX (but maybe tasks were added since that).

This is not a problem for the taskbrowser because we use the requester
asynchronously. So any suggestion on how to improve this situation is
welcome.

(oh, and the requester seems to crash when there's no task. That's a bug)




Follow ups

References