Skip to content

Commit 1535f05

Browse files
move CROSSREF_UNAVAILABLE_DELAY to settings.py
1 parent daaa67e commit 1535f05

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

osf/management/commands/sync_doi_metadata.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
from osf.models import GuidMetadataRecord, Identifier, Registration, Preprint
99
from framework.celery_tasks import app
1010
from website.identifiers.clients.exceptions import CrossRefUnavailableError
11+
from website.settings import CROSSREF_UNAVAILABLE_DELAY
12+
1113

1214
logger = logging.getLogger(__name__)
1315

1416

1517
RATE_LIMIT_RETRY_DELAY = 60 * 5
16-
CROSSREF_UNAVAILABLE_DELAY = 24 * 60 * 60
1718

1819

1920
@app.task(name='osf.management.commands.sync_doi_metadata', bind=True, acks_late=True, max_retries=5, default_retry_delay=RATE_LIMIT_RETRY_DELAY)

website/preprints/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from framework.celery_tasks import app as celery_app
66
from framework.postcommit_tasks.handlers import enqueue_postcommit_task, get_task_from_postcommit_queue
77
from website.identifiers.clients.exceptions import CrossRefUnavailableError
8+
from website.settings import CROSSREF_UNAVAILABLE_DELAY
89

910

1011
CROSSREF_FAIL_RETRY_DELAY = 12 * 60 * 60
@@ -69,7 +70,6 @@ def update_or_enqueue_on_preprint_updated(preprint_id, saved_fields=None):
6970
@celery_app.task(bind=True, acks_late=True, max_retries=5, default_retry_delay=CROSSREF_FAIL_RETRY_DELAY)
7071
def mint_doi_on_crossref_fail(self, preprint_id):
7172
from osf.models import Preprint
72-
from osf.management.commands.sync_doi_metadata import CROSSREF_UNAVAILABLE_DELAY
7373

7474
preprint = Preprint.load(preprint_id)
7575
vg = preprint.versioned_guids.first()

website/settings/defaults.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ def parent_dir(path):
341341
CROSSREF_PASSWORD = None
342342
CROSSREF_URL = None # Location to POST crossref data. In production, change this to the production CrossRef API endpoint
343343
CROSSREF_DEPOSITOR_EMAIL = 'None' # This email will receive confirmation/error messages from CrossRef on submission
344+
CROSSREF_UNAVAILABLE_DELAY = 24 * 60 * 60
344345

345346
ECSARXIV_CROSSREF_USERNAME = None
346347
ECSARXIV_CROSSREF_PASSWORD = None

0 commit comments

Comments
 (0)