Skip to content

ScheduledDataLoaderRegistry.newScheduledRegistry() creates new ScheduledExecutorService on every invocation #134

Closed
@kilink

Description

@kilink

Calling ScheduledDataLoaderRegistry.newScheduledRegistry() creates a new ScheduledExecutorService on every call, regardless of whether one is passed to the builder or not.

To reproduce:

ScheduledExecutorService myScheduledExecutor = Executors.newSingleThreadScheduledExecutor();
ScheduledDataLoaderRegistry registry = ScheduledDataLoaderRegistry.newScheduledRegistry().scheduledExecutorService(myScheduledExecutor).build();

This is due to the builder field being initialized with a default; it might be better to initialize the field to null and then only create a new ScheduledExecutorService if a custom one is not passed in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions