Implement token management and authentication features with logging
This commit is contained in:
@@ -2,12 +2,15 @@ import logging
|
||||
import subprocess
|
||||
import sys
|
||||
import os
|
||||
import api_security as auth
|
||||
import time
|
||||
|
||||
|
||||
open("api.log", "w").close()
|
||||
open("app.log", "w").close()
|
||||
open("api_server.log", "w").close()
|
||||
|
||||
try:
|
||||
os.remove("api.log")
|
||||
os.remove("api_server.log")
|
||||
os.remove("app.log")
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
#Logging
|
||||
logging.basicConfig(
|
||||
filename='app.log', # Log to a file
|
||||
@@ -37,3 +40,11 @@ cli_process = subprocess.Popen([sys.executable, "cli.py"])
|
||||
api_process.wait()
|
||||
cli_process.wait()
|
||||
|
||||
# automatic durataion validation check
|
||||
while True:
|
||||
time.sleep(300)
|
||||
try:
|
||||
auth.check_validaty()
|
||||
|
||||
except Exception as e:
|
||||
logging.info(e)
|
||||
|
||||
Reference in New Issue
Block a user