mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 12:30:56 +01:00
When cluster.instance is defined, use it to namespace S3 objects
Summary: Ref T7163. This isn't //technically// necessary but seems generally desirable. Test Plan: Will deploy S3 in production. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7163 Differential Revision: https://secure.phabricator.com/D11770
This commit is contained in:
parent
5a9d70707b
commit
3a8cd60bab
1 changed files with 13 additions and 6 deletions
|
@ -32,12 +32,19 @@ final class PhabricatorS3FileStorageEngine
|
|||
// files more browsable with web/debugging tools like the S3 administration
|
||||
// tool.
|
||||
$seed = Filesystem::readRandomCharacters(20);
|
||||
$parts = array(
|
||||
substr($seed, 0, 2),
|
||||
substr($seed, 2, 2),
|
||||
substr($seed, 4),
|
||||
);
|
||||
$name = 'phabricator/'.implode('/', $parts);
|
||||
$parts = array();
|
||||
$parts[] = 'phabricator';
|
||||
|
||||
$instance_name = PhabricatorEnv::getEnvConfig('cluster.instance');
|
||||
if (strlen($instance_name)) {
|
||||
$parts[] = $instance_name;
|
||||
}
|
||||
|
||||
$parts[] = substr($seed, 0, 2);
|
||||
$parts[] = substr($seed, 2, 2);
|
||||
$parts[] = substr($seed, 4);
|
||||
|
||||
$name = implode('/', $parts);
|
||||
|
||||
AphrontWriteGuard::willWrite();
|
||||
$profiler = PhutilServiceProfiler::getInstance();
|
||||
|
|
Loading…
Reference in a new issue