Skip to content
This repository
Browse code

Fix timing code in cancel_tasks.ml

The last time_this is timing more than it says it is!

Signed-off-by: John Else <john.else@citrix.com>
  • Loading branch information...
commit d542e65a1306d411ba35c1ca8f78748bc6b7757c 1 parent dbd1565
John Else authored November 06, 2012

Showing 1 changed file with 5 additions and 4 deletions. Show diff stats Hide diff stats

  1. 9  ocaml/xapi/cancel_tasks.ml
9  ocaml/xapi/cancel_tasks.ml
@@ -57,10 +57,11 @@ let update_all_allowed_operations ~__context =
57 57
 		List.iter (safe_wrapper "allowed_ops" (fun self ->
58 58
 			Db.SR.set_current_operations ~__context ~self ~value:[];
59 59
 			Xapi_sr_operations.update_allowed_operations ~__context ~self)) all_srs;
60  
-			debug "Finished updating allowed operations: SR";
61  
-			debug "Updating allowed operations: host";
62  
-			List.iter (safe_wrapper "allowed_ops - host" (fun self -> Xapi_host_helpers.update_allowed_operations ~__context ~self)) all_hosts;
63  
-			debug "Finished updating allowed operations: host")
  60
+		debug "Finished updating allowed operations: SR");
  61
+	time_this "Cancel_tasks.update_all_allowed_operations: host" (fun () ->
  62
+		debug "Updating allowed operations: host";
  63
+		List.iter (safe_wrapper "allowed_ops - host" (fun self -> Xapi_host_helpers.update_allowed_operations ~__context ~self)) all_hosts;
  64
+		debug "Finished updating allowed operations: host")
64 65
 
65 66
 (* !!! This code was written in a world when tasks, current_operations and allowed_operations were persistent.
66 67
    This is no longer the case (we changed this to reduce writes to flash for OEM case + to simplify xapi logic elsewhere).

0 notes on commit d542e65

Please sign in to comment.
Something went wrong with that request. Please try again.