Skip to content

Commit fbe76ba

Browse files
committed
Update to work with new replicas design
1 parent 3fd0ce6 commit fbe76ba

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

server.dist.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ let explain = (() => {
3939
}
4040

4141
const pool = mysql.createPool({
42-
database: 'enwiki_p',
43-
host: env.db_host,
42+
database: database,
43+
host: env.db_host.replace('*', database.replace(/_p$/, '')),
4444
port: env.db_port,
4545
user: env.db_user,
4646
password: env.db_password

server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ async function explain(sql, database) {
147147
}
148148

149149
const pool = mysql.createPool({
150-
database: 'enwiki_p',
151-
host: env.db_host,
150+
database: database,
151+
host: env.db_host.replace('*', database.replace(/_p$/, '')),
152152
port: env.db_port,
153153
user: env.db_user,
154154
password: env.db_password

templates/index.twig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ SELECT page_namespace, page_is_new, COUNT(*)
4747
FROM revision
4848
JOIN actor ON actor_id = rev_actor
4949
JOIN page ON rev_page = page_id AND page_namespace IN (0,1) AND page_is_redirect = 1
50-
JOIN centralauth_p.globaluser ON gu_name = actor_name
51-
WHERE gu_home_db = 'enwiki' AND rev_len > '2000' AND actor_name LIKE 'Ada%'
50+
WHERE rev_len > '2000' AND actor_name LIKE 'Ada%'
5251
GROUP BY page_namespace, page_is_new{#-
5352
-#}{% endif %}{#-
5453
-#}</textarea>

0 commit comments

Comments
 (0)