Commit 305bbcdc authored by Lukáš Lalinský's avatar Lukáš Lalinský

Don't run merge_missing_mbids in

parent d91e8cca
Pipeline #20411 passed with stages
in 2 minutes and 43 seconds
......@@ -3,10 +3,17 @@
# Copyright (C) 2011 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
from acoustid.data.track import merge_missing_mbids
logger = logging.getLogger(__name__)
def main(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('Not running merge_missing_mbids in slave mode')
return
conn = script.engine.connect()
with conn.begin():
merge_missing_mbids(conn)
# Copyright (C) 2015 Lukas Lalinsky
# Distributed under the MIT license, see the LICENSE file for details.
import logging
from acoustid import tables
logger = logging.getLogger(__name__)
QUERIES = [
('account.all', 'SELECT count(*) FROM account'),
......@@ -55,6 +58,7 @@ def get_track_count_stats(db, query):
def main(script, opts, args):
if script.config.cluster.role != 'master':
logger.info('Not running update_stats in slave mode')
return
db = script.engine.connect()
......@@ -62,13 +66,16 @@ def main(script, opts, args):
insert = tables.stats.insert()
for name, query in QUERIES:
logger.info('Updating stats %s', name)
value = db.execute(query).scalar()
db.execute(insert.values({'name': name, 'value': value}))
for i, value in get_track_count_stats(db, MBID_TRACK_QUERY):
name = 'mbid.%dtracks' % i
logger.info('Updating stats %s', name)
db.execute(insert.values({'name': name, 'value': value}))
for i, value in get_track_count_stats(db, TRACK_MBID_QUERY):
name = 'track.%dmbids' % i
logger.info('Updating stats %s', name)
db.execute(insert.values({'name': name, 'value': value}))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment