Added created_at to session metadata
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import requests
|
||||
import threading
|
||||
import os
|
||||
import time
|
||||
from .request import buildRequest
|
||||
|
||||
#session = requests.Session()
|
||||
@@ -15,6 +16,7 @@ def getSession(reset=False):
|
||||
if not hasattr(_thread_local, "session"):
|
||||
session = requests.Session()
|
||||
session.name = threading.current_thread().name
|
||||
session.created_at = time.monotonic()
|
||||
_thread_local.session = session
|
||||
|
||||
return _thread_local.session
|
||||
@@ -23,7 +25,7 @@ def getSession(reset=False):
|
||||
def executeRequest(action, outputs, resolved):
|
||||
session = getSession()
|
||||
|
||||
session_log = bool(os.environ.get("LOGS_SESSION", False))
|
||||
session_log = os.environ.get("LOGS_SESSION", "false").lower() == "true"
|
||||
|
||||
if session_log:
|
||||
print(
|
||||
|
||||
Reference in New Issue
Block a user