LrTasks, SQLite and caching questions
For the last couple of weeks, I've picked up Lua again and I've been trying to wrap my head around LrTasks and how to best use it.
I am working on a plugin that makes a call to sqlite using LrTasks.execute() to get some info from the catalog (that is not available via the SDK).
I am monitoring the time it takes for the task making the call using waitForGlobal function I found in the forums and the average is about 2-4 seconds.
The call works fine, but if I run the plugin again immediately to fetch the same info, the call time becomes zero and the rest of the codes executes before the call finished outputing the result to the temp file.
Any suggestions on how to fix this? What I am trying to figure out is:
- Why is the second call time always zero?
- Is there some caching happening or some other mechanism that I may not be aware of ?
- Do I need to consider killing the task and if so, how?
Thanks
