#!/usr/bin/python3.12
import sys
import subprocess
import logging

LOG_FILE = "exec_download_delays.log"

def main():

	print("Content-Type: text/html\n\n")

	logging.info("Exec Download Delays started")
	try:
		if True:
			subprocess.Popen([sys.executable,"download_delays.py",LOG_FILE], 
				 stdout=subprocess.DEVNULL,
				 stderr=subprocess.DEVNULL,
				 start_new_session=True)
		
	except Exception:
		logging.exception("Exec Download Delays failed")	
		
	
if __name__ == "__main__":
	
	logging.basicConfig(
		filename = LOG_FILE,
		level = logging.INFO,
		format = "%(asctime)s ¦ %(levelname)s ¦ %(message)s"
	)
	main()

	