Cron作业未在Google App Engine + Laravel 4中执行

问题描述 投票:1回答:1

我要将Laravel 4中开发的应用程序转移到Google App Engine。 我已按照本教程中提到的步骤进行操作

https://gae-php-tips.appspot.com/2013/10/22/getting-started-with-laravel-on-php-for-app-engine/

一切顺利。 要在Google App引擎中设置cron jb,我创建了一个cron.yaml文件。 但是问题是它没有被执行。 我一直在寻找解决方案,但对此一无所获。 以下是我的cron.yaml文件

cron:
 - description: Todo reminder
   url: /gae_cron/todo_reminder
   schedule: every 1 minutes from 00:00 to 23:59

我的app.yaml文件

application: test
version: beta-1-11
runtime: php55
api_version: 1

handlers:

    - url: /favicon\.ico
      static_files: public/favicon.ico
      upload: public/favicon\.ico

    - url: /packages
      static_dir: public/packages

    - url: /assets
      static_dir: public/assets

    - url: /views
      static_dir: public/views

    - url: /.*
      script: public/index.php

这是我从cron.yaml呼叫的路线

 Route::get('gae_cron/todo_reminder', function() {
   Log::info('todo reminder route');
 });

但是我在日志中什么都看不到。 但是,当我通过直接在浏览器中粘贴url来执行它时,它会显示在日志中。

有没有人设法通过Laravel在GAE中完成cron工作。

php google-app-engine laravel laravel-4 crontab
1个回答
1
投票

根据Google App Engine文档

You can use appcfg.py to upload cron jobs and view information about the defined cron jobs. When you upload your application to App Engine using appcfg.py update, the Cron Service is updated with the contents of cron.yaml. You can update just the cron configuration without uploading the rest of the application using appcfg.py update_cron

分别上传cron条目

appcfg.py -A <project-id> update_cron .

验证goto

Compute->App Engine->Task queues

在那里,您将找到cron.yaml文件中提到的所有cron条目。

© www.soinside.com 2019 - 2024. All rights reserved.