Currently, there is an issue with the package where the service object in the ExamplesController is being instantiated for every request received, rather than being initialized once when the application starts. This can potentially lead to performance problems, especially if the service constructor involves time-consuming operations such as loading data into memory.
Code excerpt illustrating the problem:
@Controller("examples")
class ExamplesController:
service: ExamplesService = Depends(ExamplesService)
# ...
Expected Behavior:
Ideally, the service object should be instantiated once during the application's startup process and reused for subsequent requests.
Currently, there is an issue with the package where the service object in the ExamplesController is being instantiated for every request received, rather than being initialized once when the application starts. This can potentially lead to performance problems, especially if the service constructor involves time-consuming operations such as loading data into memory.
Code excerpt illustrating the problem:
Expected Behavior:
Ideally, the service object should be instantiated once during the application's startup process and reused for subsequent requests.