-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Composition postgres 142 #147
Conversation
Codecov Report
@@ Coverage Diff @@
## master #147 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 20 21 +1
Lines 796 817 +21
Branches 79 81 +2
=====================================
+ Hits 796 817 +21
Continue to review full report at Codecov.
|
procrastinate/store.py
Outdated
@@ -13,37 +11,22 @@ def get_channel_for_queues(queues: Optional[Iterable[str]] = None) -> Iterable[s | |||
return ["procrastinate_queue#" + queue for queue in queues] | |||
|
|||
|
|||
class BaseJobStore: | |||
class JobStore: | |||
json_dumps: Optional[Callable] = None | |||
json_loads: Optional[Callable] = None |
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.
To be removed.
procrastinate/app.py
Outdated
|
||
@property | ||
def job_store(self) -> store.JobStore: | ||
return store.JobStore(connector=self.connector) |
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.
instantiate in constructor
You can squash them if you want. |
b49b216
to
5abaed4
Compare
5abaed4
to
9683ef2
Compare
LGTY ? |
docs/howto/testing.rst
Outdated
Procrastinate defines an `InMemoryJobStore` that will speed up your tests, | ||
remove dependency to PostgreSQL and allow you to have tasks run in a | ||
Procrastinate defines an `InMemoryConnector` that will speed up your tests, | ||
remove dependency to PostgreSQL and allows you to have tasks run in a |
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.
s/allows/allow, because of will
earlier in the sentence.
) | ||
|
||
def stop(self): | ||
if self._connection: | ||
interrupt_wait(connection=self._connection) |
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.
Did you purposefully remove stop
here?
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.
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.
In that case there shouldn't be a stop
method in the InMemoryConnector
either, no?
procrastinate/app.py
Outdated
@@ -51,13 +57,29 @@ def __init__( | |||
A :py:func:`App.task` that has a custom "name" parameter, that is not | |||
imported and whose module path is not in this list will | |||
fail to run. | |||
job_store: | |||
**Deprecated**: Old name of ``connector`` |
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.
Final dot for consistency with the other docstrings.
procrastinate/aiopg_connector.py
Outdated
connection=await self.get_connection(), socket_timeout=self.socket_timeout | ||
# This can be called from a signal handler, better not do async stuff | ||
def interrupt_wait(self): | ||
if not self._connection: |
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 think we need to have if not self._connection or self._connection.closed
here.
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.
A few comments/questions, but otherwise looks very good. Good to merge whenever you think it's ready! Thanks!
Closes #142
Includes breaking changes (but I kept a compat layer and added a deprecation warning)
Successful PR Checklist: