Skip to content

Commit c9c53eb

Browse files
committed
fix cron job to request popularity data
1 parent 001530f commit c9c53eb

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

docker/services/cron/crontab

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ MAILTO=""
5959
0 9 * * 0 root /usr/local/bin/python /code/listenbrainz/manage.py spark cron_request_similarity_datasets >> /logs/similarity_datasets.log 2>&1
6060

6161
# run weekly cron job to update popularity datasets
62-
0 10 * * 0 root /usr/local/bin/python /code/listenbrainz/manage.py spark request_popularity >> /logs/popularity_datasets.log 2>&1
62+
0 10 * * 0 root /usr/local/bin/python /code/listenbrainz/manage.py spark cron_request_popularity >> /logs/popularity_datasets.log 2>&1
6363

6464
# delete old and expired user data exports
6565
0 11 * * * root /usr/local/bin/python /code/listenbrainz/manage.py delete-old-user-data-exports >> /logs/user_data_exports.log 2>&1

listenbrainz/spark/request_manage.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def request_similar_users(max_num_users):
357357
" (the limit is instructive. upto 2x recordings may be returned than"
358358
" the limit).", required=True)
359359
@click.option("--skip", type=int, help="the minimum difference threshold to mark track as skipped", required=True)
360-
def request_similar_recordings(session, contribution, threshold, limit, skip):
360+
def request_similar_recordings_mlhd(session, contribution, threshold, limit, skip):
361361
""" Send the cluster a request to generate similar recordings index. """
362362
send_request_to_spark_cluster(
363363
"similarity.recording.mlhd",
@@ -569,3 +569,12 @@ def cron_request_similarity_datasets(ctx):
569569
threshold=10, limit=100, skip=30, production=True)
570570
ctx.invoke(request_similar_artists, days=7500, session=300, contribution=5,
571571
threshold=10, limit=100, skip=30, production=True)
572+
573+
574+
@cli.command(name='cron_request_popularity')
575+
@click.pass_context
576+
def cron_request_popularity(ctx):
577+
for entity in ["artist", "recording", "release", "release_group"]:
578+
ctx.invoke(request_popularity, mlhd=False, entity=entity)
579+
for entity in ["recording", "release", "release_group"]:
580+
ctx.invoke(request_per_artist_popularity, mlhd=False, entity=entity)

0 commit comments

Comments
 (0)