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
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)
);