CleanUpUnmatchedIPs 错误:时间戳是公元前 270 万年

看起来这是由 screened_ip_addresses 表中损坏的 last_match_at 值引起的。

您可以通过在 Rails 控制台中运行以下命令来修复它(./launcher enter app 然后是 rails c):

# 首先,找到有问题记录
ScreenedIpAddress.where("last_match_at < '0001-01-01'").each do |sip|
  puts "ID: #{sip.id}, IP: #{sip.ip_address}, last_match_at: #{sip.last_match_at}"
end

# 然后删除它
ScreenedIpAddress.where("last_match_at < '0001-01-01'").destroy_all

# 或者将时间戳修复为 `NULL`(这样清理逻辑将使用 `created_at` 而不是它)
ScreenedIpAddress.where("last_match_at < '0001-01-01'").update_all(last_match_at: nil)