Mercurial > urweb
comparison src/settings.sml @ 1308:714e8b84221b
-limit for running time
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Thu, 14 Oct 2010 11:35:56 -0400 |
parents | d2ad997ca157 |
children | 0d8bd8ae8417 |
comparison
equal
deleted
inserted
replaced
1307:d2ad997ca157 | 1308:714e8b84221b |
---|---|
490 fun setOnError x = onError := x | 490 fun setOnError x = onError := x |
491 fun getOnError () = !onError | 491 fun getOnError () = !onError |
492 | 492 |
493 val limits = ["messages", "clients", "headers", "page", "heap", "script", | 493 val limits = ["messages", "clients", "headers", "page", "heap", "script", |
494 "inputs", "subinputs", "cleanup", "deltas", "transactionals", | 494 "inputs", "subinputs", "cleanup", "deltas", "transactionals", |
495 "globals", "database"] | 495 "globals", "database", "time"] |
496 | 496 |
497 val limitsList = ref ([] : (string * int) list) | 497 val limitsList = ref ([] : (string * int) list) |
498 fun addLimit (v as (name, _)) = | 498 fun addLimit (v as (name, _)) = |
499 if List.exists (fn name' => name' = name) limits then | 499 if List.exists (fn name' => name' = name) limits then |
500 limitsList := v :: !limitsList | 500 (limitsList := v :: !limitsList; |
501 if name = "time" then | |
502 setDeadlines true | |
503 else | |
504 ()) | |
501 else | 505 else |
502 raise Fail ("Unknown limit category '" ^ name ^ "'") | 506 raise Fail ("Unknown limit category '" ^ name ^ "'") |
503 fun limits () = !limitsList | 507 fun limits () = !limitsList |
504 | 508 |
505 end | 509 end |