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

Task that clears old polls results #695

Open
Leosantos25 opened this issue Apr 10, 2021 · 5 comments
Open

Task that clears old polls results #695

Leosantos25 opened this issue Apr 10, 2021 · 5 comments

Comments

@Leosantos25
Copy link

Hi everyone,

We've recently noticed this task that apparently clears results for old polls (90 days prior to the current date):

def clear_old_poll_results(org, since, until):

.
The question is: why is this task necessary since we want to display data for longer that? Any particular reason?

Thanks in advance.

@matmsa27
Copy link
Contributor

Some UReporters customers have questioned why old polls has no data

@matmsa27
Copy link
Contributor

Hi @norkans7 , can you help us with this?

@norkans7
Copy link
Contributor

@matmsa27 @Leosantos25 on rapidpro flow runs for flows older than 90days are moved to the archives.
And to keep U-Report DB small and performant we clear those unnecessary results, in that process we mark the poll as stopped_syncing and the stats are calculated one more last time.

If polls are missing stats then you can investigate to know the reason why for each.

You can refresh the results and that will use the archives for older polls,
Recently we also added a fix to make sure we always pull results from archives for polls that were added when the flow runs were already moved to archives

@Leosantos25
Copy link
Author

Leosantos25 commented Apr 22, 2021

@norkans7 Alright, so the idea is to give older polls 90 one last update and store them.
What is interesting here is the amount of polls displaying no results, especially the ones between 2018-2019 we had to refresh.
Maybe it was something that was really affecting polls some time ago but has been fixed?

Do you remember having to deal with this a couple of years ago, maybe other workspaces hosts?

Thanks for the help!

@norkans7
Copy link
Contributor

Previously we assumed polls are added as soon as the flow is created/sent on RapidPro.
that was not quite right as some admins add polls after more that 90 days after the are sent so that required the results to be manually synced by restarting that task for it
Now that is addressed to make sure those polls gets the initial results properly #696

For every polls that did not have results, we restarted them until we added that recent way to address that automatically.

You can investigate to make sure that is the same problem as there might be other reasons for not having results for a poll.

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

No branches or pull requests

3 participants