-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Admin and move its methods to JobManager #349
Conversation
tests/conftest.py
Outdated
def serial(): | ||
return itertools.count(1) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove this? The job_factory
fixture still uses it…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it wouldn't make more sense to make an undefered job, and then let the manager defer it. The InMemory backend already maintains a counter.
(Anyway, WIP :D )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. But with this the object provided by the new job_factory
fixture (that you'd named deferred_job_factory
) would a coroutine function. So that would imply doing job = await job_factory(…)
instead of job = job_factory(…)
everywhere we use that fixture. That's a lot of changes. I'd suggest that, if we want to do that, we do it with a separate PR.
tests/conftest.py
Outdated
|
||
return factory | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't see the reason for this new fixture. It's not used currently.
procrastinate/manager.py
Outdated
for row in await self.connector.execute_query_all_async( | ||
query=sql.queries["list_tasks"], | ||
queue_name=queue, | ||
name=task, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be task_name=task
here.
I added a WIP3 commit (a wommit in our new jargon :) that fixes the tests. |
Codecov Report
@@ Coverage Diff @@
## master #349 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 29 28 -1
Lines 1575 1568 -7
Branches 172 171 -1
=========================================
- Hits 1575 1568 -7
Continue to review full report at Codecov.
|
cbf7485
to
bf13f0b
Compare
Remove the Admin class and move its methods to JobManager. Co-authored-by: Éric Lemoine <[email protected]>
I fixed the tests, and improved the doc strings making sure that the generated API reference looks good. I think this is ready for merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 (cannot approve my own PR)
Closes #333
Successful PR Checklist: