]> xenbits.xensource.com Git - people/aperard/osstest.git/commitdiff
Database locking: Tcl: Use db-update-1 in jobdb::become-task
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 14 Jul 2016 12:13:24 +0000 (13:13 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 14 Jul 2016 12:19:38 +0000 (13:19 +0100)
db-update-1 contains the same error check found here.  Isn't clear
from the history why db-update-1 wasn't used right from the start.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v3: New patch

tcl/JobDB-Executive.tcl

index 239f22c23e847a33bfd67eb5634f0dc9909e4800..237e07b72eb0babf89546787cbdce80246c2d509 100644 (file)
@@ -275,17 +275,14 @@ proc become-task {comment} {
     set username "[id user]@$hostname"
 
     transaction resources {
-        set nrows [db-execute "
+        db-update-1 "
             UPDATE tasks
                SET username = [pg_quote $username],
                    comment = [pg_quote $comment]
              WHERE taskid = $taskid
                AND type = [pg_quote [lindex $refinfo 0]]
                AND refkey = [pg_quote [lindex $refinfo 1]]
-        "]
-    }
-    if {$nrows != 1} {
-        error "$nrows $taskid $refinfo ?"
+        "
     }
 }