-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat(core): Add replicationMode for ctx and getRepository #2746
feat(core): Add replicationMode for ctx and getRepository #2746
Conversation
Hi, Thanks, this looks good. Can you make a suggestion for some documentation on this feature? At least as doc blocks on the new method/property. |
Of course, I will. I can do it tomorrow |
): Repository<Entity>; | ||
getRepository<Entity extends ObjectLiteral>( | ||
ctxOrTarget: RequestContext | ObjectType<Entity> | EntitySchema<Entity> | string | undefined, | ||
maybeTarget?: ObjectType<Entity> | EntitySchema<Entity> | string, | ||
replicationMode?: ReplicationMode, |
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.
Here it's probably better to use an object instead of a strict arg
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.
For future extensibility?
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.
yes. For example, there may be several databases in the future
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I've added documentation to this code. We actively use the master connection in index update and other methods, such as email-send or SMS-send, to ensure that at the time of processing, workers take the most up-to-date data if this data was updated less than a second ago. I'd still like to work on the Queue interface. We have identified a problem that some tasks can be executed before the transaction is completed on the server. |
60cdae3
into
vendure-ecommerce:minor
Hey, thanks for finding the time to complete this PR! It now strikes me that we should have a page in our
Yeah an issue outlining the problem & proposed solution would be a good start :+1 |
Description
This PR includes improvements for connecting to the database if you are using multiple replicas and when you need to connect to Master without using TransactionManager
Breaking changes