bulkmail_record_failed_host hostWhat it does:
Records a host as failed. If host has reached the acceptable failures threshhold, we delete it from the list of hosts.Defined in: /web/philip/tcl/bulkmail-utils.tcl
Source code:
ns_share bulkmail_failed_hosts_mutex
ns_share bulkmail_failed_hosts
ns_share bulkmail_hosts_mutex
ns_share bulkmail_hosts
ns_share bulkmail_current_host
ns_log Notice "Processing failed host: $host"
bulkmail_reset_hosts_if_needed
ns_mutex lock $bulkmail_failed_hosts_mutex
catch {
set n_failures [ns_set get $bulkmail_failed_hosts $host]
if { [empty_string_p $n_failures] } {
set n_failures 0
}
incr n_failures
ns_set delkey $bulkmail_failed_hosts $host
ns_set put $bulkmail_failed_hosts $host $n_failures
}
ns_mutex unlock $bulkmail_failed_hosts_mutex
if { $n_failures > [bulkmail_acceptable_host_failures] } {
ns_mutex lock $bulkmail_hosts_mutex
catch {
set list_index [lsearch -exact $bulkmail_hosts $host]
# Check to see if we found this host (the index >= 0)
if { $list_index >= 0 } {
set bulkmail_hosts [lreplace $bulkmail_hosts $list_index $list_index]
}
}
ns_mutex unlock $bulkmail_hosts_mutex
ns_log Notice "Removed failed host: $host"
}