Fix use req_token_expiration_sec when creating a task session and not the default value

This commit is contained in:
clearml 2024-10-28 18:11:42 +02:00
parent 0ff428bb96
commit 205cd47cb9

View File

@ -1183,7 +1183,10 @@ class Worker(ServiceCommandSection):
Requires that agent session credentials will allow impersonation as task user Requires that agent session credentials will allow impersonation as task user
""" """
def get_new_session(session, headers): def get_new_session(session, headers):
result = session.send(auth_api.LoginRequest(), headers=headers) result = session.send(
auth_api.LoginRequest(expiration_sec=session.req_token_expiration_sec),
headers=headers
)
if not (result.ok() and result.response): if not (result.ok() and result.response):
return return
new_session = copy(session) new_session = copy(session)