MCPcopy Create free account
hub / github.com/adobe/Marinus / download_whois_data

Function download_whois_data

python3_cron_scripts/download_from_remote_database.py:117–131  ·  view source on GitHub ↗

Download the latest whois information.

(logger, whois_collection, remote_whois_collection)

Source from the content-addressed store, hash-verified

115
116
117def download_whois_data(logger, whois_collection, remote_whois_collection):
118 """
119 Download the latest whois information.
120 """
121 logger.info("Beginning Whois download")
122 whois_results = remote_whois_collection.find({}, {"_id": 0}).batch_size(50)
123
124 for result in whois_results:
125 whois_collection.replace_one({"zone": result["zone"]}, result, upsert=True)
126
127 # Establish a date four months back
128 scrub_date = datetime.now() - timedelta(days=120, hours=9)
129
130 # Remove data from four months back
131 whois_collection.delete_many({"updated": {"$lte": scrub_date}})
132
133
134def check_zones(domain, zones):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected