Commit Graph

4 Commits

Author SHA1 Message Date
Javi Martín
9759288f3b Run DB rake tasks on all tenants
Some tasks don't have to run on every tenant. The task to calculate the
TSV is only done for records which were present before we added the TSV
column, and that isn't going to happen in any tenants because we added
the TSV column before adding the tenants table. Similarly, the migration
needed for existing polls isn't necessary because there weren't any
tenants before we allowed to set the starting/ending time to polls.

We aren't adding any tests for these tasks because tests for rake tasks
are slow and tests creating tenants are also slow, making the
combination of the two even slower, particularly if we add tests for
every single task we're changing. We're adding tests for the
`.run_on_each` method instead.
2022-11-09 18:19:20 +01:00
Javi Martín
01a01c834d Only generate stats if we can access them
There's no point generating stats nobody can access.

Note with this change we're automatically excluding polls created in the
dashboard, since these polls don't have stats enabled.
2019-11-09 19:34:24 +01:00
Javi Martín
1d0b05832c Add info messages for release 1.0.0 tasks
So users know what's going on when they upgrade CONSUL.
2019-06-05 20:23:56 +02:00
Javi Martín
13dd77dd1b Add tasks to generate and expire stats cache
We're generating stats every 2 hours because it's less than the time it
will take to generate stats for every process. Once stats are generated,
this task should take less than a second.

The regenerate task has been added so we can manually execute it.
2019-05-21 13:50:19 +02:00