Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/publisher/DivinerLivePublisher.php
| Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | protected function deleteDocumentsByHash(array $hashes) { | ||||
| $symbol_table = new DivinerLiveSymbol(); | $symbol_table = new DivinerLiveSymbol(); | ||||
| $conn_w = $symbol_table->establishConnection('w'); | $conn_w = $symbol_table->establishConnection('w'); | ||||
| $strings = array(); | $strings = array(); | ||||
| foreach ($hashes as $hash) { | foreach ($hashes as $hash) { | ||||
| $strings[] = qsprintf($conn_w, '%s', $hash); | $strings[] = qsprintf($conn_w, '%s', $hash); | ||||
| } | } | ||||
| foreach (PhabricatorLiskDAO::chunkSQL($strings, ', ') as $chunk) { | foreach (PhabricatorLiskDAO::chunkSQL($strings) as $chunk) { | ||||
| queryfx( | queryfx( | ||||
| $conn_w, | $conn_w, | ||||
| 'UPDATE %T SET graphHash = NULL, nodeHash = NULL | 'UPDATE %T SET graphHash = NULL, nodeHash = NULL | ||||
| WHERE graphHash IN (%Q)', | WHERE graphHash IN (%LQ)', | ||||
| $symbol_table->getTableName(), | $symbol_table->getTableName(), | ||||
| $chunk); | $chunk); | ||||
| } | } | ||||
| queryfx( | queryfx( | ||||
| $conn_w, | $conn_w, | ||||
| 'DELETE a FROM %T a LEFT JOIN %T s | 'DELETE a FROM %T a LEFT JOIN %T s | ||||
| ON a.symbolPHID = s.phid | ON a.symbolPHID = s.phid | ||||
| ▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines | |||||