Commit b2e2edf3 authored by Frank Bergmann's avatar Frank Bergmann

- SLA Management:

  Fixed issue with non-integer epochs
parent d6af39fd
......@@ -369,16 +369,18 @@ ad_proc -public im_sla_ticket_solution_time_sweeper {
if {[catch {
append result [im_sla_ticket_solution_time_sweeper_helper -debug_p $debug_p -ticket_id $ticket_id -limit $limit]
} err_msg]} {
ns_log Error "im_sla_ticket_solution_time_sweeper: solution time: Found error: $err_msg"
append result "<pre>$err_msg</pre>"
global errorInfo
ns_log Error "im_sla_ticket_solution_time_sweeper: solution time: Found error: $err_msg, $errorInfo"
append result "<pre>$err_msg\n\n$errorInfo</pre>"
}
# Catch errors calculating the green/yellow/red status of tickets
if {[catch {
append result [im_sla_ticket_traffic_light_sweeper_helper -debug_p $debug_p -ticket_id $ticket_id -limit $traffic_light_limit]
} err_msg]} {
ns_log Error "im_sla_ticket_solution_time_sweeper: traffic light status: Found error: $err_msg"
append result "<pre>$err_msg</pre>"
global errorInfo
ns_log Error "im_sla_ticket_solution_time_sweeper: traffic light status: Found error: $err_msg, $errorInfo"
append result "<pre>$err_msg\n\n$errorInfo</pre>"
}
# De-block the execution of this procedure for a 2nd thread
......@@ -902,7 +904,7 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
set audit_sql "
select *,
a.audit_object_id as ticket_id,
extract(epoch from a.audit_date) as audit_date_epoch,
round(extract(epoch from a.audit_date)) as audit_date_epoch,
to_char(a.audit_date, 'J') as audit_date_julian,
im_category_from_id(audit_object_status_id) as audit_object_status,
substring(audit_value from 'ticket_queue_id\\t(\[^\\n\]*)') as audit_ticket_queue_id,
......@@ -1017,6 +1019,11 @@ ad_proc -public im_sla_ticket_solution_time_sweeper_helper {
ns_log Notice "im_sla_ticket_solution_time_sweeper: Looping through events for ticket_id=$ticket_id"
foreach e [lsort [array names hash]] {
if {![string is integer $e]} {
ns_log Error "im_sla_ticket_solution_time_sweeper_helper: Found epoch='$e' in hash, skipping"
continue
}
set event_full $hash($e)
set event [lindex $event_full 0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment