Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15353992
D20853.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D20853.diff
View Options
diff --git a/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php b/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php
--- a/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php
+++ b/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php
@@ -498,7 +498,7 @@
private function setCloseFlagOnCommits(array $identifiers) {
$repository = $this->getRepository();
$commit_table = new PhabricatorRepositoryCommit();
- $conn_w = $commit_table->establishConnection('w');
+ $conn = $commit_table->establishConnection('w');
$vcs = $repository->getVersionControlSystem();
switch ($vcs) {
@@ -515,13 +515,27 @@
throw new Exception(pht("Unknown repository type '%s'!", $vcs));
}
- $all_commits = queryfx_all(
- $conn_w,
- 'SELECT id, phid, commitIdentifier, importStatus FROM %T
- WHERE repositoryID = %d AND commitIdentifier IN (%Ls)',
- $commit_table->getTableName(),
- $repository->getID(),
- $identifiers);
+ $identifier_tokens = array();
+ foreach ($identifiers as $identifier) {
+ $identifier_tokens[] = qsprintf(
+ $conn,
+ '%s',
+ $identifier);
+ }
+
+ $all_commits = array();
+ foreach (PhabricatorLiskDAO::chunkSQL($identifier_tokens) as $chunk) {
+ $rows = queryfx_all(
+ $conn,
+ 'SELECT id, phid, commitIdentifier, importStatus FROM %T
+ WHERE repositoryID = %d AND commitIdentifier IN (%LQ)',
+ $commit_table->getTableName(),
+ $repository->getID(),
+ $chunk);
+ foreach ($rows as $row) {
+ $all_commits[] = $row;
+ }
+ }
$closeable_flag = PhabricatorRepositoryCommit::IMPORTED_CLOSEABLE;
@@ -539,7 +553,7 @@
if (!($row['importStatus'] & $closeable_flag)) {
queryfx(
- $conn_w,
+ $conn,
'UPDATE %T SET importStatus = (importStatus | %d) WHERE id = %d',
$commit_table->getTableName(),
$closeable_flag,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 12, 1:29 AM (4 w, 8 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7565996
Default Alt Text
D20853.diff (1 KB)
Attached To
Mode
D20853: When a large number of commits need to be marked as published, issue the lookup query in chunks
Attached
Detach File
Event Timeline
Log In to Comment