-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regular refresh ClinVar individual from Case (#158)
Related-Issue: #158 Projected-Results-Impact: none
- Loading branch information
Showing
5 changed files
with
81 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"""Django management command for triggering clinvar_export individual update.""" | ||
|
||
from django.core.management.base import BaseCommand | ||
|
||
from clinvar_export.models import refresh_individual_sex_affected | ||
|
||
|
||
class Command(BaseCommand): | ||
#: Help message displayed on the command line. | ||
help = "Refresh ClinVar export individual sex/affected attributes." | ||
|
||
def handle(self, *args, **options): | ||
"""The actual implementation is in ``_handle()``, splitting to get commit times.""" | ||
self.stderr.write(self.style.NOTICE("Refreshing all clinvar_xml individuals")) | ||
refresh_individual_sex_affected() | ||
self.stderr.write(self.style.NOTICE("All done. Have a nice day!")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from celery.schedules import crontab | ||
from config.celery import app | ||
|
||
from clinvar_export import models | ||
|
||
|
||
@app.task(bind=True) | ||
def refresh_individual_sex_affected(_self): | ||
models.refresh_individual_sex_affected() | ||
|
||
|
||
@app.on_after_finalize.connect | ||
def setup_periodic_tasks(sender, **_kwargs): | ||
"""Register periodic tasks""" | ||
sender.add_periodic_task(schedule=crontab(minute=11), sig=refresh_individual_sex_affected.s()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters