Refactor rate limiter and datetime formatting
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
import logging
|
||||
import smtplib
|
||||
|
||||
from . import datetime_str
|
||||
from email.mime.text import MIMEText
|
||||
|
||||
|
||||
@@ -91,11 +93,11 @@ Hostname: {hostname}
|
||||
"""
|
||||
if last_ipv4:
|
||||
ip = last_ipv4[0]
|
||||
last_update = last_ipv4[1].strftime("%Y-%m-%d %H:%M:%S")
|
||||
last_update = datetime_str(last_ipv4[1])
|
||||
body += f"IPv4 address: {ip} (last update: {last_update})\n"
|
||||
if last_ipv6:
|
||||
ip = last_ipv6[0]
|
||||
last_update = last_ipv6[1].strftime("%Y-%m-%d %H:%M:%S")
|
||||
last_update = datetime_str(last_ipv6[1])
|
||||
body += f"IPv6 address: {ip} (last update: {last_update})\n"
|
||||
body += f"""Expiry TTL: {expiry_ttl} seconds
|
||||
|
||||
|
||||
Reference in New Issue
Block a user