summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-04-09 08:34:40 +0200
committerYorhel <git@yorhel.nl>2020-04-09 08:35:32 +0200
commit6fd9ceb051538f11829b7d9b2919665dbeca70ed (patch)
tree5944f52bd30a92aa56bb165e5db4674d527660cf /util
parent443fc2d8bc509b2231b4b34cb420b84d158a1b02 (diff)
Stop keeping track of users/threads/posts count cache
Those stats havent been displayed on the site for ages, anyway. The API will now report '0' for these stats.
Diffstat (limited to 'util')
-rw-r--r--util/updates/2020-04-09-stats-cleanup.sql10
-rwxr-xr-xutil/vndb.pl3
2 files changed, 10 insertions, 3 deletions
diff --git a/util/updates/2020-04-09-stats-cleanup.sql b/util/updates/2020-04-09-stats-cleanup.sql
new file mode 100644
index 00000000..ccd87569
--- /dev/null
+++ b/util/updates/2020-04-09-stats-cleanup.sql
@@ -0,0 +1,10 @@
+DROP TRIGGER stats_cache_new ON threads;
+DROP TRIGGER stats_cache_edit ON threads;
+DROP TRIGGER stats_cache_new ON threads_posts;
+DROP TRIGGER stats_cache_edit ON threads_posts;
+DROP TRIGGER stats_cache ON users;
+
+DELETE FROM stats_cache WHERE section IN('users', 'threads', 'threads_posts');
+
+\i sql/triggers.sql
+\i sql/func.sql
diff --git a/util/vndb.pl b/util/vndb.pl
index d926a04e..3a7dd714 100755
--- a/util/vndb.pl
+++ b/util/vndb.pl
@@ -66,9 +66,6 @@ TUWF::hook before => sub {
# Use a 'SameSite=Strict' cookie to determine whether this page was loaded from internal or external.
# Ought to be more reliable than checking the Referer header, but it's unfortunately a bit uglier.
tuwf->resCookie(samesite => 1, httponly => 1, samesite => 'Strict') if !tuwf->samesite;
-
- # load some stats (used for about all pageviews, anyway)
- tuwf->{stats} = tuwf->dbStats;
};