2018-02-15 04:04:46 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$table = new HarbormasterBuildable();
|
|
|
|
$conn = $table->establishConnection('w');
|
|
|
|
|
|
|
|
foreach (new LiskMigrationIterator($table) as $buildable) {
|
|
|
|
if ($buildable->getBuildableStatus() !== 'building') {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$aborted = queryfx_one(
|
|
|
|
$conn,
|
2018-02-17 13:31:16 +01:00
|
|
|
'SELECT * FROM %T WHERE buildablePHID = %s AND buildStatus = %s
|
|
|
|
LIMIT 1',
|
2018-02-15 04:04:46 +01:00
|
|
|
id(new HarbormasterBuild())->getTableName(),
|
|
|
|
$buildable->getPHID(),
|
|
|
|
'aborted');
|
|
|
|
if (!$aborted) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
queryfx(
|
|
|
|
$conn,
|
|
|
|
'UPDATE %T SET buildableStatus = %s WHERE id = %d',
|
|
|
|
$table->getTableName(),
|
|
|
|
'failed',
|
|
|
|
$buildable->getID());
|
|
|
|
}
|