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

fix: default invalid key #1719

Merged
merged 2 commits into from
Dec 6, 2024
Merged

fix: default invalid key #1719

merged 2 commits into from
Dec 6, 2024

Conversation

martingold
Copy link
Contributor

@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) December 4, 2024 09:33
Copy link

github-actions bot commented Dec 4, 2024

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes-contrib/flex/pull-1719/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes-contrib/flex/pull-1719/index.json
  2. Install the package(s) related to this recipe:

    composer req symfony/flex
    composer req 'fluffydiscord/roadrunner-symfony-bundle:^3.0'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes.
I'm going keep this comment up to date with any updates of the attached patch.

fluffydiscord/roadrunner-symfony-bundle

2.3 vs 3.0
diff --git a/fluffydiscord/roadrunner-symfony-bundle/2.3/config/packages/fluffy_discord_road_runner.yaml b/fluffydiscord/roadrunner-symfony-bundle/3.0/config/packages/fluffy_discord_road_runner.yaml
index b8ccb966..99c8894f 100644
--- a/fluffydiscord/roadrunner-symfony-bundle/2.3/config/packages/fluffy_discord_road_runner.yaml
+++ b/fluffydiscord/roadrunner-symfony-bundle/3.0/config/packages/fluffy_discord_road_runner.yaml
@@ -19,6 +19,21 @@ fluffy_discord_road_runner:
         # and then use dynamic worker scaling as described here https://docs.roadrunner.dev/php-worker/scaling
         lazy_boot: false
 
+        # Optional
+        # -----------
+        # This decides if Symfony routing should be preloaded when worker starts and boots Symfony kernel.
+        # This option halves the initial request response time.
+        # (based on a project with over 400 routes and quite a lot of services, YMMW)
+        #
+        # true (default in PROD) - sends one dummy (empty) HTTP request to the kernel to initialize routing and services around it
+        # false (default in DEV) - only when first worker request arrives, routing and services are loaded
+        #
+        # You might want to create a dummy "/" route for the route to "land",
+        # or listen to onKernelRequest events and look in the request for the attribute
+        # FluffyDiscord\RoadRunnerBundle\Worker\HttpWorker::DUMMY_REQUEST_ATTRIBUTE
+        # Set this to "false" if you have any issues and report them to me.
+        early_router_initialization: true
+
     # https://docs.roadrunner.dev/plugins/centrifuge
     centrifugo:
         # Optional
@@ -49,3 +64,8 @@ fluffy_discord_road_runner:
         # for end-to-end encryption. "sodium" php extension is required.
         # https://docs.roadrunner.dev/key-value/overview-kv#end-to-end-value-encryption
         keypair_path: bin/keypair.key
+
+when@dev:
+    fluffy_discord_road_runner:
+        http:
+            early_router_initialization: false

Copy link
Member

@diimpp diimpp left a comment

Choose a reason for hiding this comment

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

Hi @martingold , http part cannot be on top, so I assume it should be the other way around.

image

Co-authored-by: Dmitri Perunov <[email protected]>
auto-merge was automatically disabled December 5, 2024 15:08

Head branch was pushed to by a user without write access

@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) December 5, 2024 15:08
@martingold
Copy link
Contributor Author

You are correct, fixed. Thanks!

@fabpot fabpot disabled auto-merge December 6, 2024 14:25
@fabpot fabpot merged commit ec201ea into symfony:main Dec 6, 2024
1 of 2 checks passed
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.

3 participants