.
// cancel a WU:
// - mark unsent results as OVER, outcome DIDNT_NEED
// - set CANCELLED bit in WU error mask
//
require_once("../inc/util_ops.inc");
function test_mysql_query($msg) {
echo "mysql_query($msg)
";
return 1;
}
// for purposes of testing and seeing queries,
// replace the two instances of mysql_query() below with test_mysql_query().
//
function cancel_wu($wuid1, $wuid2) {
$command1="update result set server_state=5, outcome=5 where server_state=2 and $wuid1<=workunitid and workunitid<=$wuid2";
$command2="update workunit set error_mask=error_mask|16 where $wuid1<=id and id<=$wuid2";
if (!mysql_query($command1)) {
echo "MySQL command $command1 failed:
unable to cancel unsent results.
";
return 1;
} else if (!mysql_query($command2)) {
echo "MySQL command $command2 failed:
unable to cancel workunits.
";
return 2;
}
// trigger the transitioner (it will set file_delete_state)
$now = time();
$query="update workunit set transition_time=$now where $wuid1<=id and id<=$wuid2";
mysql_query($query);
return 0;
}
require_once("../inc/db.inc");
require_once("../inc/util_ops.inc");
admin_page_head("Cancel WU");
db_init();
$wuid1 = $_GET['wuid1'];
$wuid2 = $_GET['wuid2'];
if ($wuid1<1 || $wuid2<$wuid1) {
echo "