Skip to content

Commit ae39f5d

Browse files
committed
clarify comments
1 parent 222df31 commit ae39f5d

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
@@ -6,9 +6,11 @@
66
from jupyter_scheduler.utils import get_utc_timestamp
77

88

9-
def initiate_download_standalone(job_id: str, queue: Queue, db_session, redownload: bool = False):
9+
def initiate_download_standalone(
10+
job_id: str, download_queue: Queue, db_session, redownload: bool = False
11+
):
1012
"""
11-
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.
13+
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.
1214
"""
1315
download_initiated_time = get_utc_timestamp()
1416
download_id = generate_uuid()
@@ -21,7 +23,7 @@ def initiate_download_standalone(job_id: str, queue: Queue, db_session, redownlo
2123
download_record = Download(**download.dict())
2224
db_session.add(download_record)
2325
db_session.commit()
24-
queue.put(download)
26+
download_queue.put(download)
2527

2628

2729
class DownloadRecordManager:
@@ -66,7 +68,7 @@ def __init__(self, db_url: str):
6668
def initiate_download(self, job_id: str, redownload: bool):
6769
with self.record_manager.session() as session:
6870
initiate_download_standalone(
69-
job_id=job_id, queue=self.queue, db_session=session, redownload=redownload
71+
job_id=job_id, download_queue=self.queue, db_session=session, redownload=redownload
7072
)
7173

7274
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)