Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@alexander-schranz
Copy link
Contributor

@alexander-schranz alexander-schranz commented May 10, 2022

When using a symfony application which run on swoole or roadrunner the services need to be resetted between the runs. Same for messenger:consume command services are resetted and require this call.

We did stumble else over problems with the caches and needed to add the kernel.reset tag to the doctrine caches: https://github.com/sulu/skeleton/pull/141/files

The reset method was implemented here and also reseted the Namespace correctly:

https://github.com/symfony/cache/blob/4c6747cf7e56c6b8e3094dd24852bd3e364375b1/DoctrineProvider.php#L49-L55

This seems not to be added when moved the DoctrineProvider from Symfony/Cache to this repository: #366

Symfony itself added the reset in this pull request. symfony/symfony#24226. Maybe @nicolas-grekas can also gave insights about the get set Namespace here.

return null;
}

public function reset()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not require an interface for this as the service_resetter of symfony doesn't require anything here: https://github.com/symfony/symfony/blob/6.1/src/Symfony/Component/HttpKernel/DependencyInjection/ServicesResetter.php

@alexander-schranz
Copy link
Contributor Author

The failing tests seems to be unrelated to this pull request, as they fail in MemomizeCache tests.

@derrabus
Copy link
Member

Please rebase. The CI should be green now. Also, can you please add a test that covers your change?

@alexander-schranz
Copy link
Contributor Author

@derrabus Thx, rebased!

@derrabus
Copy link
Member

I'd like to merge this. Can you please add tests?

@alexander-schranz
Copy link
Contributor Author

@derrabus Test cases added.

@derrabus derrabus changed the title Fix resetting of Psr6 DoctrineProvider Add reset() to PSR-6 DoctrineProvider May 20, 2022
@derrabus derrabus changed the base branch from 1.12.x to 1.13.x May 20, 2022 20:03
@derrabus derrabus added this to the 1.13.0 milestone May 20, 2022
@derrabus derrabus merged commit 56cd022 into doctrine:1.13.x May 20, 2022
derrabus added a commit that referenced this pull request May 20, 2022
* 1.13.x:
  Add reset() to PSR-6 DoctrineProvider (#398)
@derrabus
Copy link
Member

Released as 1.13.0 and 2.2.0.

@alexander-schranz alexander-schranz deleted the patch-1 branch May 20, 2022 20:24
@alexander-schranz
Copy link
Contributor Author

@derrabus Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants