Skip to content

Commit a1154f1

Browse files
committed
clean up
1 parent b61045c commit a1154f1

1 file changed

Lines changed: 5 additions & 20 deletions

File tree

runpod/serverless/modules/rp_scale.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -99,26 +99,11 @@ async def get_jobs(self, session):
9999
if not self.is_alive():
100100
break
101101

102-
sequential = True
103-
tasks = []
104-
if sequential:
105-
for _ in range(self.num_concurrent_get_job_requests):
106-
job = await get_job(session, retry=False)
107-
self.job_history.append(1 if job else 0)
108-
if job:
109-
yield job
110-
else:
111-
tasks = [
112-
asyncio.create_task(
113-
get_job(session, retry=False)
114-
) for _ in range(self.num_concurrent_get_job_requests)]
115-
116-
for job_future in asyncio.as_completed(tasks):
117-
job = await job_future
118-
self.job_history.append(1 if job else 0)
119-
120-
if job:
121-
yield job
102+
for _ in range(self.num_concurrent_get_job_requests):
103+
job = await get_job(session, retry=False)
104+
self.job_history.append(1 if job else 0)
105+
if job:
106+
yield job
122107

123108
# During the single processing scenario, wait for the job to finish processing.
124109
if self.concurrency_controller is None:

0 commit comments

Comments
 (0)