Skip to content

Commit

Permalink
History logging
Browse files Browse the repository at this point in the history
  • Loading branch information
not7cd committed Jul 1, 2018
1 parent c0366e3 commit 8d175d3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions whois/history.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import atexit
from datetime import datetime

Expand All @@ -6,13 +7,18 @@
from whois.database import History, Device
from whois.helpers import owners_from_devices, filter_hidden, unclaimed_devices

logger = logging.getLogger(__name__)

logger.info("Created BackgroundScheduler")
cron = Scheduler(daemon=True)
cron.start()


@cron.scheduled_job(**log_frequency_time)
def log_presence():
logger = logging.getLogger(__name__)
logger.info("logging presence to history")

now = datetime.now()
recent = Device.get_recent(**log_frequency_time)
visible_devices = filter_hidden(recent)
Expand Down

0 comments on commit 8d175d3

Please sign in to comment.