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

[Configuration] Fix parallel config always replaced by next config as default to true #181

Merged
merged 1 commit into from
Mar 3, 2024

Conversation

samsonasik
Copy link
Collaborator

@Reinis here to fix #180

The existing ECSConfigBuilder::$parallel property is default to true, so the $ecsConfig->parallel() is always called, instead, it needs to be nullable bool:

private ?bool $parallel = null;

with default to null, and call parallel() or disableParallel() when it enabled/disabled:

        if ($this->parallel !== null) {
            if ($this->parallel) {
                $ecsConfig->parallel(
                    seconds: $this->parallelTimeoutSeconds,
                    maxNumberOfProcess: $this->parallelMaxNumberOfProcess,
                    jobSize: $this->parallelJobSize
                );
            } else {
                $ecsConfig->disableParallel();
            }
        }

To ensure it enabled by default on the project, I set entry point in config/config.php:

# config/config.php
return ECSConfig::configure()
    ->withParallel()

I tried in this repo and it seems working ok 👍

@samsonasik samsonasik changed the title [Configuration] Fix paralll config always replaced by next config as default to true [Configuration] Fix parallel config always replaced by next config as default to true Mar 3, 2024
@samsonasik
Copy link
Collaborator Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

@TomasVotruba
Copy link
Contributor

Looks good to me 👍 Thanks

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 this pull request may close these issues.

Old style config not loading properly
2 participants