Skip to content

Add Extra Time to BuilderΒ #101

@TheBuggs

Description

@TheBuggs

I have a problem when using a package in my test environment to check all dependencies. When I have many different CSS files, the build process takes more time because the process duration, which is around 60 seconds, is not stable, causing my deployment to crash. I have added extra time (add 10 min), but can you add functionality to configure this through a config file or suggest another simple solution?

I will provide my workaround:

composer.json

    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd",
            "importmap:install": "symfony-cmd"
        },
        "update-timeout": [
            "php update_timeout.php"
        ],
        "post-install-cmd": [
            "@auto-scripts",
            "@update-timeout"
        ],
        "post-update-cmd": [
            "@auto-scripts",
            "@update-timeout"
        ]
    },

update_time.php

<?php

function updateTimeout($filePath): void
{
    $fileContents = file_get_contents($filePath);

    if ($fileContents === false) {
        die("Error: Unable to read the file at $filePath");
    }

    $lines = explode(PHP_EOL, $fileContents);
    $newLines = [];
    $lineToAdd = '$process->setTimeout(600);';

    foreach ($lines as $line) {
        $newLines[] = $line;

        if (trim($line) === '$process = $binary->createProcess($arguments);') {
            $newLines[] = $lineToAdd;
        }
    }

    $updatedContents = implode(PHP_EOL, $newLines);
    $result = file_put_contents($filePath, $updatedContents);

    if ($result === false) {
        die("Error: Unable to write to the file at $filePath");
    }

    echo "Timeout added successfully in $filePath.\n";
}

$filePath = __DIR__ . '/vendor/symfonycasts/tailwind-bundle/src/TailwindBuilder.php';
updateTimeout($filePath);

Thanks a lot!

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