@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Disable repository read/write synchronization for now

Summary:
This nearly works but I didn't have time to get back to it and it isn't stable enough to turn on in the cluster yet.

We have enough other stuff going out this week, so just disable it before `stable` gets cut. Should be ready by next week if things go well.

Test Plan: Fetched a Git SSH repo locally.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D15731

+22 -6
+22 -6
src/applications/repository/storage/PhabricatorRepository.php
··· 2269 2269 /* -( Cluster Synchronization )-------------------------------------------- */ 2270 2270 2271 2271 2272 + private function shouldEnableSynchronization() { 2273 + // TODO: This mostly works, but isn't stable enough for production yet. 2274 + return false; 2275 + 2276 + $device = AlmanacKeys::getLiveDevice(); 2277 + if (!$device) { 2278 + return false; 2279 + } 2280 + 2281 + return true; 2282 + } 2283 + 2284 + 2272 2285 /** 2273 2286 * @task sync 2274 2287 */ 2275 2288 public function synchronizeWorkingCopyBeforeRead() { 2276 - $device = AlmanacKeys::getLiveDevice(); 2277 - if (!$device) { 2289 + if (!$this->shouldEnableSynchronization()) { 2278 2290 return; 2279 2291 } 2280 2292 2281 2293 $repository_phid = $this->getPHID(); 2294 + 2295 + $device = AlmanacKeys::getLiveDevice(); 2282 2296 $device_phid = $device->getPHID(); 2283 2297 2284 2298 $read_lock = PhabricatorRepositoryWorkingCopyVersion::getReadLock( ··· 2332 2346 * @task sync 2333 2347 */ 2334 2348 public function synchronizeWorkingCopyBeforeWrite() { 2335 - $device = AlmanacKeys::getLiveDevice(); 2336 - if (!$device) { 2349 + if (!$this->shouldEnableSynchronization()) { 2337 2350 return; 2338 2351 } 2339 2352 2340 2353 $repository_phid = $this->getPHID(); 2354 + 2355 + $device = AlmanacKeys::getLiveDevice(); 2341 2356 $device_phid = $device->getPHID(); 2342 2357 2343 2358 $write_lock = PhabricatorRepositoryWorkingCopyVersion::getWriteLock( ··· 2375 2390 * @task sync 2376 2391 */ 2377 2392 public function synchronizeWorkingCopyAfterWrite() { 2378 - $device = AlmanacKeys::getLiveDevice(); 2379 - if (!$device) { 2393 + if (!$this->shouldEnableSynchronization()) { 2380 2394 return; 2381 2395 } 2382 2396 ··· 2388 2402 } 2389 2403 2390 2404 $repository_phid = $this->getPHID(); 2405 + 2406 + $device = AlmanacKeys::getLiveDevice(); 2391 2407 $device_phid = $device->getPHID(); 2392 2408 2393 2409 // NOTE: This means we're still bumping the version when pushes fail. We