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

Cronjob support? #578

Open
nadar opened this issue Jan 31, 2025 · 0 comments
Open

Cronjob support? #578

nadar opened this issue Jan 31, 2025 · 0 comments

Comments

@nadar
Copy link

nadar commented Jan 31, 2025

Hi everyone

Does cronjobs work with the php runtime? I tested a few things, but it seems not to work. Can anyone confirm this or is there a workaround?

I use laravel 11 (the webproject itself works perfectly) with the following vercel.json

{
    "version": 2,
    "regions": [
        "fra1"
    ],
    "functions": {
        "api/index.php": {
            "runtime": "[email protected]"
        }
    },
    "routes": [
        {
            "src": "/build/(.*)",
            "dest": "/build/$1"
        },
        {
            "src": "/(.*\\.(?:css|js|png|jpg|jpeg|gif|svg|ico|ttf|woff|woff2|eot|otf|webp|avif|txt|webmanifest))$",
            "dest": "/public/$1"
        },
        {
            "src": "/(.*)",
            "dest": "/api/index.php"
        }
    ],
    "outputDirectory": "public",
    "crons": [
        {
            "path": "/api/cron",
            "schedule": "*/5 * * * *"
        }
    ]
}

i have registered a route in routes/web.php like Route::get('/cron', function () {...} and i tested with

"crons": [
        {
            "path": "/cron",
            "schedule": "*/5 * * * *"
        }
    ]

and

"crons": [
        {
            "path": "/api/cron",
            "schedule": "*/5 * * * *"
        }
    ]

but both seems not to work, i think its because of the none official runtime?

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

No branches or pull requests

1 participant