Skip to content

Commit bc4bc88

Browse files
committed
clarify comments
1 parent 92a4574 commit bc4bc88

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

jupyter_scheduler/download_manager.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
from jupyter_scheduler.pydantic_v1 import BaseModel
88

99

10-
def initiate_download_standalone(job_id: str, queue: Queue, db_session, redownload: bool = False):
10+
def initiate_download_standalone(
11+
job_id: str, download_queue: Queue, db_session, redownload: bool = False
12+
):
1113
"""
12-
This static method initiates a download in a standalone manner independent of the DownloadManager instance. It is suitable for use in multiprocessing environment where a direct reference to DownloadManager instance is not feasible.
14+
This method initiates a download in a standalone manner independent of the DownloadManager instance. It is suitable for use in multiprocessing environment where a direct reference to DownloadManager instance is not feasible.
1315
"""
1416
download_initiated_time = get_utc_timestamp()
1517
download_id = generate_uuid()
@@ -22,7 +24,7 @@ def initiate_download_standalone(job_id: str, queue: Queue, db_session, redownlo
2224
download_record = Download(**download.dict())
2325
db_session.add(download_record)
2426
db_session.commit()
25-
queue.put(download)
27+
download_queue.put(download)
2628

2729

2830
class DownloadRecordManager:
@@ -67,7 +69,7 @@ def __init__(self, db_url: str):
6769
def initiate_download(self, job_id: str, redownload: bool):
6870
with self.record_manager.session() as session:
6971
initiate_download_standalone(
70-
job_id=job_id, queue=self.queue, db_session=session, redownload=redownload
72+
job_id=job_id, download_queue=self.queue, db_session=session, redownload=redownload
7173
)
7274

7375
def delete_download(self, download_id: str):

jupyter_scheduler/executors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def execute(self):
155155
with self.db_session() as session:
156156
initiate_download_standalone(
157157
job_id=job.job_id,
158-
queue=self.download_queue,
158+
download_queue=self.download_queue,
159159
db_session=session,
160160
redownload=True,
161161
)

0 commit comments

Comments
 (0)