Skip to content
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

Move calendar resource/room backend registration to IBootstrap #31007

Conversation

ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Feb 4, 2022

Fixes #29563

Old registration

		$serverContainer = $context->getServerContainer();

		/** @var IResourceManager $resourceManager */
		/** @var IRoomManager $roomManager */
		$resourceManager = $serverContainer->get(IResourceManager::class);
		$roomManager = $serverContainer->get(IRoomManager::class);

		$resourceManager->registerBackend(Connector\Resource\Backend::class);
		$roomManager->registerBackend(Connector\Room\Backend::class);

^ only possible during boot, which imposes a potential loading order problem. Moreover both managers have to be instantiated and therefore cause a performance overhead for requests that don't need the backends.

New registration

		$context->registerCalendarResourceBackend(Connector\Resource\Backend::class);
		$context->registerCalendarRoomBackend(Connector\Room\Backend::class);

^ happens during register. No performance overhead, it's two string appended to arrays.

I've tested it with the modified calendar_resource_management. The backends are still loaded and processed during the background job.

Ref nextcloud/calendar_resource_management#45

Copy link
Contributor

@miaulalala miaulalala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Tested it and booked a few rooms, works fine.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@ChristophWurst ChristophWurst force-pushed the enhancement/bootstrap-calendar-resource-room-backend-registration branch from 7bddab4 to 9a656e5 Compare February 7, 2022 11:51
@ChristophWurst
Copy link
Member Author

test failure unrelated

@ChristophWurst ChristophWurst merged commit cd7a217 into master Feb 9, 2022
@ChristophWurst ChristophWurst deleted the enhancement/bootstrap-calendar-resource-room-backend-registration branch February 9, 2022 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement feature: caldav Related to CalDAV internals feature: dav pending documentation This pull request needs an associated documentation update performance 🚀 technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New IBootstrap registration for resource and room back ends
3 participants