X-Git-Url: http://git.annexia.org/?p=whenjobs.git;a=blobdiff_plain;f=daemon%2Fdaemon.ml;h=25b81b7a86a4caa7e8b3ab51edd59e42cc647d5f;hp=c3e1abd33f605dc46955bc442d5e339ff7465074;hb=545581eb916ac5f020295b59458e16af51ea6cc5;hpb=f35f462b83f860958da38347d30b45986b8f4774 diff --git a/daemon/daemon.ml b/daemon/daemon.ml index c3e1abd..25b81b7 100644 --- a/daemon/daemon.ml +++ b/daemon/daemon.ml @@ -400,15 +400,15 @@ and handle_sigchld _ = let job, dir, serial, time = IntMap.find pid !runningmap in runningmap := IntMap.remove pid !runningmap; serialmap := BigIntMap.remove serial !serialmap; - cleanup_job job dir serial time status + post_job job dir serial time status ) with Unix_error _ | Not_found -> () -and cleanup_job job dir serial time status = - (* If there is a cleanup function, run it. *) - (match job.job_cleanup with +and post_job job dir serial time status = + (* If there is a post function, run it. *) + (match job.job_post with | None -> () - | Some cleanup -> + | Some post -> let code = match status with | WEXITED c -> c @@ -421,12 +421,12 @@ and cleanup_job job dir serial time status = res_output = dir // "output.txt"; res_start_time = time } in - try cleanup result + try post result with | Failure msg -> - Syslog.error "job %s cleanup function failed: %s" job.job_name msg + Syslog.error "job %s post function failed: %s" job.job_name msg | exn -> - Syslog.error "job %s cleanup function exception: %s" + Syslog.error "job %s post function exception: %s" job.job_name (Printexc.to_string exn) );