You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this instantiates the repository and gets back the expected result. After this, I am manually setting some properties on the repository class so that it could be used ahead in the future.
But when I hit an controller endpoint for the first time which injects this repository ,
export class UserController extends AuthenticationControllerMixin<
User,
Constructor<Object>
>(Object, options) {
constructor(
@inject('repositories.UserRepository')
public userRepository: UserRepository,
@service(ImagekitProvider) public imagekit: Imagekit
) {
super();
}
it creates a new instance of the Repository again, but further API hits don't.
What would be the reason the new Repository instance is getting generated 2 times
with the application.get.
when hitting a Controller endpoint for the first time.
This discussion was converted from issue #6728 on March 11, 2021 13:42.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Team,
I am developing a component which takes binding keys for repositories from the configuration, and I am fetching those repositories by code like below,
this instantiates the repository and gets back the expected result. After this, I am manually setting some properties on the repository class so that it could be used ahead in the future.
But when I hit an controller endpoint for the first time which injects this repository ,
it creates a new instance of the Repository again, but further API hits don't.
What would be the reason the new Repository instance is getting generated 2 times
Beta Was this translation helpful? Give feedback.
All reactions