Added asycn requests
There are currently no pipelines.
To run a merge request pipeline, the jobs in the CI/CD configuration file must be configured to run in merge request pipelines and you must have sufficient permissions in the source project.
Created by: waraich1
subreddit = self.reddit.subreddit(subredditName)
for submission in subreddit.hot(limit=num):
post_comment = comment.get_comment(submission.id, "hot", False, self.token)
res.extend(post_comment)
return res
async def do_tasks():
async with httpx.AsyncClient() as client:
tasks = [client.get(url, headers=headers, follow_redirects=True) for url in res]
result = await asyncio.gather(*tasks)
return result
res = asyncio.run(do_tasks())
This makes all the get requests concurrently which imroves the time
To run a merge request pipeline, the jobs in the CI/CD configuration file must be configured to run in merge request pipelines and you must have sufficient permissions in the source project.