mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 21:02:41 +01:00
e10fdbe77e
Summary: Patches often read from slaves (possibly stale data) and use that information to write on master. It causes problems when applying more patches quickly after each other because data created in previous patch may not be replicated yet. Test Plan: $ bin/storage upgrade Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4483
22 lines
523 B
PHP
22 lines
523 B
PHP
<?php
|
|
|
|
echo "Generating file keys...\n";
|
|
$table = new PhabricatorFile();
|
|
$table->openTransaction();
|
|
$table->beginReadLocking();
|
|
|
|
$files = $table->loadAllWhere('secretKey IS NULL');
|
|
echo count($files).' files to generate keys for';
|
|
foreach ($files as $file) {
|
|
queryfx(
|
|
$file->establishConnection('w'),
|
|
'UPDATE %T SET secretKey = %s WHERE id = %d',
|
|
$file->getTableName(),
|
|
$file->generateSecretKey(),
|
|
$file->getID());
|
|
echo '.';
|
|
}
|
|
|
|
$table->endReadLocking();
|
|
$table->saveTransaction();
|
|
echo "\nDone.\n";
|