Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating tasks run while exporting #140

Open
ValeErre87 opened this issue Mar 7, 2016 · 4 comments
Open

Updating tasks run while exporting #140

ValeErre87 opened this issue Mar 7, 2016 · 4 comments

Comments

@ValeErre87
Copy link

We need to fix some bugs we are experiencing when exporting the CVS file related to number of tasks run.

In theory, we should get an updated export every time we try to export the file from the web interface.
Unfortunately, this is not happening, so the file I obtain while exporting is not updated.

@othieno
Copy link
Member

othieno commented Mar 7, 2016

@ValeErre87 just to be clear, are you trying to export tasks or task runs?

@ValeErre87
Copy link
Author

@othieno I tried to export task runs (in CVS format).

@othieno
Copy link
Member

othieno commented Mar 16, 2016

@ValeErre87 I seem to have found a temporary solution to this. Could you try exporting and let me know if you're having issues?

For future reference (beware, here be dragons):
Why is this happening?
PyBossa creates a zip file (for instance, here's how a zipped JSON export is created) which it then caches (since the creation operation can be fairly expensive) and uploads to the requester.

From my understanding, the problem is that the once a file is cached it is never updated and is always returned when an export is requested, which breaks the assumption that up-to-date task run data can be requested at any moment.

A very quick and temporary solution is to delete the cached file, thereby forcing PyBossa to regenerate a more recent export, however this process will have to be repeated each time an export is requested. An ideal solution would be comparing the date and time the cached file was created (T_created) and the project data was last updated (T_last_updated). If T_created < T_last_updated, then the cache is updated.

I'll keep this issue open until I can push a more permanent solution.

Note: This bug has already been mentioned in issue #56.

@ValeErre87
Copy link
Author

@othieno Hey Jeremy, thank you for fixing this. It works now.
I am a bit concerned we will face the same issue next month, when I will need to export the same tasks again.
I'll keep you posted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants