Differential D19797 Diff 47275 src/applications/conduit/controller/PhabricatorConduitAPIController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/controller/PhabricatorConduitAPIController.php
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | try { | ||||
} | } | ||||
$result = null; | $result = null; | ||||
$error_code = ($ex instanceof ConduitException | $error_code = ($ex instanceof ConduitException | ||||
? 'ERR-CONDUIT-CALL' | ? 'ERR-CONDUIT-CALL' | ||||
: 'ERR-CONDUIT-CORE'); | : 'ERR-CONDUIT-CORE'); | ||||
$error_info = $ex->getMessage(); | $error_info = $ex->getMessage(); | ||||
} | } | ||||
$time_end = microtime(true); | |||||
$log | $log | ||||
->setCallerPHID( | ->setCallerPHID( | ||||
isset($conduit_user) | isset($conduit_user) | ||||
? $conduit_user->getPHID() | ? $conduit_user->getPHID() | ||||
: null) | : null) | ||||
->setError((string)$error_code) | ->setError((string)$error_code) | ||||
->setDuration(1000000 * ($time_end - $time_start)); | ->setDuration(phutil_microseconds_since($time_start)); | ||||
if (!PhabricatorEnv::isReadOnly()) { | if (!PhabricatorEnv::isReadOnly()) { | ||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | ||||
$log->save(); | $log->save(); | ||||
unset($unguarded); | unset($unguarded); | ||||
} | } | ||||
$response = id(new ConduitAPIResponse()) | $response = id(new ConduitAPIResponse()) | ||||
▲ Show 20 Lines • Show All 588 Lines • Show Last 20 Lines |