Skip to content

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

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

Closed
kilink opened this issue Nov 10, 2023 · 0 comments · Fixed by #135

Comments

@kilink
Copy link
Contributor

kilink commented Nov 10, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant