Browse Source

cron: exit 1 on exception

Allows the caller to more easily respond to cron failures.

Signed-off-by: Stephen Michel <git@smichel.me>
tags/v23.0.0beta1
smichel17 2 years ago
parent
commit
84d3a5f8e6
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      cron.php

+ 3
- 0
cron.php View File

* @author Steffen Lindner <mail@steffen-lindner.de> * @author Steffen Lindner <mail@steffen-lindner.de>
* @author Thomas Müller <thomas.mueller@tmit.eu> * @author Thomas Müller <thomas.mueller@tmit.eu>
* @author Vincent Petry <vincent@nextcloud.com> * @author Vincent Petry <vincent@nextcloud.com>
* @author Stephen Michel <git@smichel.me>
* *
* @license AGPL-3.0 * @license AGPL-3.0
* *
exit(); exit();
} catch (Exception $ex) { } catch (Exception $ex) {
\OC::$server->getLogger()->logException($ex, ['app' => 'cron']); \OC::$server->getLogger()->logException($ex, ['app' => 'cron']);
exit(1);
} catch (Error $ex) { } catch (Error $ex) {
\OC::$server->getLogger()->logException($ex, ['app' => 'cron']); \OC::$server->getLogger()->logException($ex, ['app' => 'cron']);
exit(1);
} }

Loading…
Cancel
Save