Skip to content

Commit 41f3616

Browse files
authored
Merge branch 'main' into 4784-tweaks-to-related-cases-on-new-case-law-page
2 parents bdf8d84 + eccc7b2 commit 41f3616

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

cl/api/templates/recap-api-docs-vlatest.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ <h4 id="dockets">Purchasing Dockets</h4>
229229
<h2 id="recap-upload">RECAP Upload API <small><code>{% url "processingqueue-list" version=version %}</code></small></h2>
230230
<p>This API is used by the RECAP extension and a handful of special partners to upload PACER content to the RECAP Archive. This API is not available to the public. If you have a collection of PACER data you wish to donate to the RECAP Archive so it is permanently available to the public, please <a href="{% url "contact" %}">get in touch</a>.
231231
</p>
232-
<p>We describe the process for completing these uploads below, and you can see examples of them in <a href="https://github.com/freelawproject/courtlistener/blob/main/cl/recap/tests.py">CourtListener's automated test suite</a>. Uploads to these endpoints should be done using HTTP <code>POST</code> requests and multipart form data.
232+
<p>We describe the process for completing these uploads below, and you can see examples of them in <a href="https://github.com/freelawproject/courtlistener/blob/main/cl/recap/tests/tests.py">CourtListener's automated test suite</a>. Uploads to these endpoints should be done using HTTP <code>POST</code> requests and multipart form data.
233233
</p>
234234
<p>When you make an upload, you create a <code>Processing Queue</code> object in the CourtListener system. This object will be returned in the HTTP response to your upload, so you will know its ID. This object will contain the fields you uploaded, and the following fields will be populated as the item is processed:
235235
</p>

cl/corpus_importer/signals.py

+19-11
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,19 @@ def update_latest_case_id_and_schedule_iquery_sweep(docket: Docket) -> None:
5252
tasks_to_schedule = (
5353
incoming_pacer_case_id - iquery_pacer_case_id_current
5454
)
55+
logger.info(
56+
"Found %s tasks to schedule for pacer case IDs ranging from %s to %s.",
57+
tasks_to_schedule,
58+
iquery_pacer_case_id_current,
59+
incoming_pacer_case_id,
60+
)
5561
if tasks_to_schedule > 10_800:
56-
# Considering a Celery countdown of 1 second and a visibility_timeout
57-
# of 6 hours, the maximum countdown time should be set to 21,600 to
58-
# avoid a celery runaway. It's safer to abort if more than 10,800
59-
# tasks are attempted to be scheduled. This could indicate an issue
60-
# with retrieving the highest_known_pacer_case_id or a loss of the
62+
# Considering a Celery countdown of 1 second applied via
63+
# throttle_task and a visibility_timeout of 6 hours, the maximum
64+
# countdown time should be set to 21,600 to avoid a celery runaway.
65+
# It's safer to abort if more than 10,800 tasks are attempted to be
66+
# scheduled. This could indicate an issue with retrieving the
67+
# highest_known_pacer_case_id or a loss of the
6168
# iquery_pacer_case_id_current for the court in Redis.
6269
logger.error(
6370
"Tried to schedule more than 10,800 iquery pages to scrape for "
@@ -66,20 +73,21 @@ def update_latest_case_id_and_schedule_iquery_sweep(docket: Docket) -> None:
6673
)
6774
release_redis_lock(r, update_lock_key, lock_value)
6875
return None
69-
task_scheduled_countdown = 0
76+
task_to_schedule_count = 0
7077
while iquery_pacer_case_id_current + 1 < incoming_pacer_case_id:
7178
iquery_pacer_case_id_current += 1
72-
task_scheduled_countdown += 1
73-
# Schedule the next task with a 1-second countdown increment
79+
task_to_schedule_count += 1
80+
# Schedule the next task.
7481
make_docket_by_iquery_sweep.apply_async(
7582
args=(court_id, iquery_pacer_case_id_current),
7683
kwargs={"skip_iquery_sweep": True},
77-
countdown=task_scheduled_countdown,
7884
queue=settings.CELERY_IQUERY_QUEUE,
7985
)
8086
logger.info(
81-
f"Enqueued iquery docket case ID: {iquery_pacer_case_id_current} "
82-
f"for court {court_id} with countdown {task_scheduled_countdown}"
87+
"Enqueued %s iquery docket with case ID: %s for court %s",
88+
task_to_schedule_count,
89+
iquery_pacer_case_id_current,
90+
court_id,
8391
)
8492

8593
# Update the iquery_pacer_case_id_current in Redis

0 commit comments

Comments
 (0)