瀏覽代碼

Return 503 in public.php and OCS API when upgrade is due

To prevent unexpected behavior, public.php and the OCS API calls will
return 503 Service Unavailable when an upgrade is due.
tags/v7.0.0RC1
Vincent Petry 10 年之前
父節點
當前提交
2e45eb8ad6
共有 2 個檔案被更改,包括 16 行新增0 行删除
  1. 8
    0
      ocs/v1.php
  2. 8
    0
      public.php

+ 8
- 0
ocs/v1.php 查看文件

@@ -23,6 +23,14 @@

require_once '../lib/base.php';

if (\OCP\Util::needUpgrade()) {
// since the behavior of apps or remotes are unpredictable during
// an upgrade, return a 503 directly
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
OC_Template::printErrorPage('Service unavailable');
exit;
}

use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;


+ 8
- 0
public.php 查看文件

@@ -3,6 +3,14 @@
try {

require_once 'lib/base.php';
if (\OCP\Util::needUpgrade()) {
// since the behavior of apps or remotes are unpredictable during
// an upgrade, return a 503 directly
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
OC_Template::printErrorPage('Service unavailable');
exit;
}

OC::checkMaintenanceMode();
OC::checkSingleUserMode();
$pathInfo = OC_Request::getPathInfo();

Loading…
取消
儲存