369 |
with e -> |
with e -> |
370 |
lprintf_nl "[cInt] Exception in contact_remove: %s" (Printexc2.to_string e) |
lprintf_nl "[cInt] Exception in contact_remove: %s" (Printexc2.to_string e) |
371 |
|
|
372 |
|
let exit_counter = ref 0 |
373 |
|
let exit_timer = ref false |
374 |
|
|
375 |
|
let rec clean_exit n = |
376 |
|
let can_exit = networks_for_all (fun n -> network_clean_exit n) in |
377 |
|
if can_exit || (!exit_counter > 3) then |
378 |
|
exit_properly n |
379 |
|
else |
380 |
|
if not !exit_timer then begin |
381 |
|
exit_timer := true; |
382 |
|
add_timer 1. (fun _ -> |
383 |
|
incr exit_counter; |
384 |
|
exit_timer := false; |
385 |
|
clean_exit n; |
386 |
|
); |
387 |
|
end |
388 |
|
|
389 |
let time_of_sec sec = |
let time_of_sec sec = |
390 |
let hours = sec / 60 / 60 in |
let hours = sec / 60 / 60 in |