Skip to content

fix(maintenance): fix multiple services creation - #3328

Closed
sylvlecl wants to merge 5 commits into
devfrom
fix/fix-worker-startup
Closed

fix(maintenance): fix multiple services creation#3328
sylvlecl wants to merge 5 commits into
devfrom
fix/fix-worker-startup

Conversation

@sylvlecl

@sylvlecl sylvlecl commented Aug 4, 2026

Copy link
Copy Markdown
Member

Services should be created only once.

Also, aligns naming of all services into Services dataclass.

Signed-off-by: Sylvain Leclerc <sylvain.leclerc@rte-france.com>
@sylvlecl sylvlecl changed the title fix(maintenance): fix worker startup fix(maintenance): fix multiple services creation Aug 4, 2026
Signed-off-by: Sylvain Leclerc <sylvain.leclerc@rte-france.com>
@pull-request-size pull-request-size Bot added size/L and removed size/M labels Aug 5, 2026
@sylvlecl
sylvlecl marked this pull request as ready for review August 5, 2026 12:34
app.dependency_overrides[get_study_service] = lambda: study_service
app.dependency_overrides[get_config] = lambda: config
app.dependency_overrides[get_output_service] = lambda: output_service
app.dependency_overrides[get_login_service] = lambda: Mock()
app.dependency_overrides[get_config] = lambda: CONFIG
app.dependency_overrides[get_output_service] = lambda: output_service
app.dependency_overrides[get_file_transfer_manager] = lambda: file_transfer_manager
app.dependency_overrides[get_login_service] = lambda: Mock()
engine = init_db_engine(config, auto_upgrade_db=False)
init_db_singleton(custom_engine=engine, session_args=SESSION_ARGS)
core_services = create_core_services(config=config)
services = create_services(config=config)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In this method invocation we re-created the core services, effectively creating duplicates.

I got an error on my local env with metrics being added multiple times.

@sylvlecl

sylvlecl commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

Should not be needed following #3331

@sylvlecl sylvlecl closed this Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant